I am trying to extract specific information from a .txt file. I have figured out a way to isolate the lines I need; however, printing them has proven to be problematic.
with open('RCSV.txt','r') as RCSV:
for line in RCSV.read().splitlines():
if line.startswith(' THETA'):
print(line.next())
When I use line.next()
it gives me this error:
"AttributeError: 'str' object has no attribute 'next'"
Here is a link to the .txt file
Here is a link to the area of the file in question
What I'm trying to do is extract the line following the line that starts with 'THETA PHI' etc.