I have a text file with looks like this:
Current job title:
meter engineer
Current salary:
£30,000
Experience:
2 years
Desired location:
Not supplied
Desired job title:
smart meter engineer
Desired salary:
£30,000
Job Type:
Permanent | Contract | Temp
Current job title:
dual fuel smart meter engineer
Current salary:
£30,000
Experience:
4 years
Desired location:
Not supplied
Desired job title:
Not supplied
Desired salary:
£34,999
Job Type:
Permanent | Contract | Temp
each line is split with a new line and the sets of data is separated by blank space I want to use python to extract the data under the headings. eg: Current job title: meter engineer would go in the Current job title column. Then grab the next set and put those on the next line
how do I achieve this using python?
I am new to python. All I can get it to do is read the file. Picking out the data using IF doesn't work.
f = open("test.txt", "r")
lines = f.readlines()
for line in lines:
print(line)