csv blank fields

Mag Gam magawake at gmail.com
Sat Jun 27 09:33:09 EDT 2009

well, I am actually loading the row into a fixed width array

for s,row in enumerate(reader):

If there is a missing field, I get a problem in one of my rows

On Sat, Jun 27, 2009 at 9:04 AM, MRAB<python at mrabarnett.plus.com> wrote:
> Mag Gam wrote:
>> I am using the csv package to parse a compressed .csv.gz file. So far
>> its working perfectly fine but it fails when I have a missing value in
>> on of the fields.
>> For example, I have this
>> Abc,def,,jkl
>> Is it possible to fill the missing column with a null?
>> I want,
>> Abc,def,NULL,jkl
> What do you mean by "fails"? I get an empty string, which is what I'd
> expect.
> --
> http://mail.python.org/mailman/listinfo/python-list

More information about the Python-list mailing list