Simple csv read/write

Drew olsonas at gmail.com
Tue Apr 24 18:27:08 EDT 2007


Ok, I'm trying to do the simplest read/write from one csv file to
another. For some reason, every other row on the output file is a
blank row. What am I doing wrong?

import csv

reader = csv.reader(open('current.csv'))
writer = csv.writer(open('new.csv','w'))

for line in reader:
    writer.writerow(line)




More information about the Python-list mailing list