I have a text file that is roughly in this form:
a
ab
x: 1 2 3 4 5 6
a
ab
x: 1 4 6 8 243 8 2
That contains thousands of similar style entries per file. I need to strip the numbers out of x into a list in python.
I currently have a text parser that creates a list of the line numbers where x appears, but the parser I have works on the fly, not line by line. Is there a way I can perform an action on the following line of the file without actually being there yet? (IE, my code is executed on line 1, checks that it meets the condition and if so performs an action on line 2 before it continues to check other line conditions.)
All of the numbers are space separated, on a single line with x.