I have a txt File that is similar to the following
example.txt
9987.000 2300 23 40 30
9654.988 1234 34 32 19
I would like to iterate over this file and rewrite it into another file sample.txt as follows each number on its own line listed vertically in order in which they are listed horizontally.
9987.000
2300
23
40
30
I am new to Python and am not sure which would be the best approach for doing something like this. Any advice is greatly appreciated. Syntax Error
File "Sample.py", line 64
with open('testFile.txt')as infile, open('testFile.txt','w') as outfile:
^
SyntaxError: invalid syntax