Python's CSV reader

Stephan usenet.filter at gmail.com
Thu Aug 4 00:36:21 EDT 2005


I'm fairly new to python and am working on parsing some delimited text
files.  I noticed that there's a nice CSV reading/writing module
included in the libraries.

My data files however, are odd in that they are composed of lines with
alternating formats. (Essentially the rows are a header record and a
corresponding detail record on the next line.  Each line type has a
different number of fields.)

Can the CSV module be coerced to read two line formats at once or am I
better off using read and split?

Thanks for your insight,
Stephan




More information about the Python-list mailing list