Re: CSV Reader
- From: Mike P <michael.pearmain@xxxxxxxxxxxxxx>
- Date: Tue, 12 Feb 2008 02:21:49 -0800 (PST)
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()
.
- Follow-Ups:
- Re: CSV Reader
- From: Chris
- Re: CSV Reader
- From: Mike P
- Re: CSV Reader
- References:
- CSV Reader
- From: Mike P
- Re: CSV Reader
- From: Larry Bates
- Re: CSV Reader
- From: Mike P
- RE: CSV Reader
- From: Ree***, Andrew
- Re: CSV Reader
- From: Mike P
- Re: CSV Reader
- From: Gabriel Genellina
- CSV Reader
- Prev by Date: Re: OT: Speed of light [was Re: Why not a Python compiler?]
- Next by Date: Re: CSV Reader
- Previous by thread: Re: CSV Reader
- Next by thread: Re: CSV Reader
- Index(es):