I have two CSV files, headers.csvand corrected.csv. headers.csvIt has all the headers, but corrected.csvjust a bunch of organized data.
headers.csv:
displacement, load, cputime, ...
corrected.csv:
-990.478170,-0.000026,15:08:06, ...
-990.038170,-0.000026,15:08:06, ...
The end goal is to be like this example:
displacement,load,cputime, ...
-990.478170,-0.000026,15:08:06, ...
-990.038170,-0.000026,15:08:06, ...
What I have:
headers = [x for x in csv.reader(open('headers.csv', 'rb'))]
writer = csv.writer(open('merged.csv', 'wb'))
writer.writerow(headers)
for row in csv.reader(open('corrected.csv', 'rb')):
writer.writerow(row)
The result, however, is that it is "['displacement', 'load', 'cputime', ...]"written to column A, but I want an offset in column A, a load in column B, cputime in column C, etc. I also want to get rid of ', ", [], and whitespacetherefore the end result exactly matches my example above. Thanks in advance!