Extract fields from the string in python
<p>I have text line by line which contains many field name and their value seperated by : , if any line does not have any field value then that field would not exist in that line
for example</p>

<pre><code>First line:
A:30 B: 40 TS:1/1/1990 22:22:22
Second line
A:30 TS:1/1/1990 22:22:22
third line
A:30 B: 40
</code></pre>

<p>But it is confirmed that at max 3 fields are possible in single line and their name will be A,B,TS.
while writing python script for this, i am facing below issues:
1) I have to extract from each line which are the field exist and what are their values
2) Field value of field TS also have seperator ' '(SPACE).so unable retrieve full value of TS(1/1/1990 22:22:22)</p>

<p>Output valueshould  be extracted like that</p>

<pre><code>First LIne:
A=30
 B=40
 TS=1/1/1990 22:22:22

Second Line:
A=30

 TS=1/1/1990 22:22:22

Third Line
A=30
 B=40
</code></pre>

<p>Please help me in solving this issue.</p>
