I need a python script to reformat a poorly formatted .txt file. I was not thinking in advanced while doing my code and ended up with a very poorly formatted .txt file. Below is an excerpt from my file(the file is 3000 lines in the full file):
27.80
92.51
76.02
16.49
27.80
91.49
76.02
15.47
27.80
90.99
76.02
14.97
Below is what I want the file to look like. Basically I want python to go through each line and change from the old bad format to this new format. Just as a heads up there are thousands of lines:
temp,cur_alt,zero_alt,dif
27.80,92.51,76.02,16.49
27.80,91.49,76.02,15.47
27.80,90.99,76.02,14.97