Python script to convert comma delimited txt files to Excel
Friday, October 31st, 2008I wrote a simple little python script to convert comma delimited .txt files to Excel spreadsheets:
import csv,sys
filein = raw_input(”Enter the input file name: “)
fileout = raw_input(”Enter the output file name: “)
fin = open(filein, ‘rb’)
fout = open(fileout, ‘wb’)
reader = csv.reader(fin)
writer = csv.writer(fout, dialect=’excel-tab’)
for row in reader:
writer.writerow(row)
fin.close()
fout.close()
Not including the blank lines it’s […]












