Script to convert comma delimited .txt files to Excel
Posted: Fri Oct 31, 2008 7:41 am
Code: Select all
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()