I am putting three fields author, epoch_date and text
in one string textData
They are separated with new row. Of course text can contain multiple rows or some special characters (#, blank spaces etc.)
textData="author:john"+"\n"+"epoch_date:53636352"+"\n"+"text:comment on_the_first_line \n line_in_the_middle \n line_at_the_end"
Now I am trying convinient way to extract those data in the easiest way in separate fields. I do not see how to do it with splitlines() since it will print me 5 rows instead of 3 because as mentioned text field can contain multiple rows.
for line in textData.splitlines():
print(line)
Also if there is better way to define textData
field I am able to modify that part as well.
Note: python 2.7 must be used, unfortunately.
Thanks