I have a list of strings which I need to go through and categorise the components. The components are in categories in the list however I'm not sure where to start.

```py
lst = [
'CAPACITOR
  C500 1u PN"1";
  C501 1u PN"2";

RESISTOR
  R100 10 PN"10";
  R101 10 PN"11";'

,

'CAPACITOR
  C500 1u PN"1";
  C507 1u PN"2";

CONNECTOR
  TP100 NT;
  TP101 NT;']

#Above formatted as it is easier to see

lst = [ 'CAPACITOR\n  C500 1u PN"1";\n  C501 1u PN"2";\n\nRESISTOR\n  R100 10 PN"10";\n  R101 10 PN"11";\n'  ,  '\nCAPACITOR\n  C500 1u PN"1";\n  C507 1u PN"2";\n\nCONNECTOR\n  TP100 NT;\n  TP101 NT;']

```

The output I expect to get is;

```py
C500 , Capacitor
C501 , Capacitor
R100 , Resistor
R101 , Resistor
C507 , Capacitor
TP100 , Connector
TP101 , Connector

```

C500 only needs to be defined once. 

I am able to get a list of just the components but have no idea how to get what category they are in.