CSV Reader

Mike P michael.pearmain at tangozebra.com
Tue Feb 12 11:21:49 CET 2008


I did just try to post, but it doesn't look like it has appeared?

I've used your advice Andrew and tried to use the CSV module, but now
it doesn't seem to pick up the startswith command?
Is this because of the way the CSV module is reading the data in?
I've looked into the module description but i can't find anything that
i hould be using?

Can anyone offer an advice?

Cheers again

Mike

working_CSV =  "//filer/common/technical/Research/E2C/Template_CSV/
DFAExposureToConversionQueryTool.csv"

save_file = "//filer/common/technical/Research/E2C/Template_CSV/
CSV_Data2.csv"

start_line=False
import csv
reader = csv.reader(open(working_CSV, "rb"))
writer = csv.writer(open(save_file, "wb"))
for row in reader:
    if not start_line and record.startswith("'Transaction ID'"):
        start_line=True
    if start_line:
    print row
        writer.writerows(rows)
#writer.close()




More information about the Python-list mailing list