I have multiple txt files which each have a column of 41 numbers. I want to write them as a collective into a CSV file.
this is what i wrote for 4 of the txt's:
import csv
b = 4
for j in range(0,b):
log_code = "/users/administrator/desktop/hbridgetest%04d .txt"%(j)
in_file = open(log_code," r")
numberof = in_file.readlin es()
in_file.close()
# write .csv file for hb data
wf=csv.writer(f ile('bridge.csv ','wb'),dialect ='excel')
wf.writerows(nu mberof)
however,
i'm just getting the last column in the CSV with the numbers split up (ie. 4156 is 4 1 5 6, each in a different column).
please help me.
this is what i wrote for 4 of the txt's:
import csv
b = 4
for j in range(0,b):
log_code = "/users/administrator/desktop/hbridgetest%04d .txt"%(j)
in_file = open(log_code," r")
numberof = in_file.readlin es()
in_file.close()
# write .csv file for hb data
wf=csv.writer(f ile('bridge.csv ','wb'),dialect ='excel')
wf.writerows(nu mberof)
however,
i'm just getting the last column in the CSV with the numbers split up (ie. 4156 is 4 1 5 6, each in a different column).
please help me.
Comment