problems with CSV module
Carlos Grohmann
carlos.grohmann at gmail.com
Thu Jun 3 15:26:03 EDT 2010
Thanks for your prompt response, Neil.
> That data doesn't appear to be csv worthy. Why not use str.split
> or str.partition?
Well, I should have said that this is one kind of data. The function
is part of a larger app, and there is the possibility that someone
uses headers in the data files, or some other field separator, so I
tried to make it more universal.
> In Python 2.6 and earlier, you need to open the file in binary
> mode.
I tried that, no changes
> Use:
> csvfile = csv.reader(csvfile, dialect=dialect)
> dialect is a keyword argument.
thanks for pointing that out.it stopped the errors when there s only
one
data line, but it still can't get the values for that line
Carlos
More information about the Python-list
mailing list