Troubles with CSV file
Vladimir Ignatov
vignatov at colorpilot.com
Fri May 14 06:08:15 EDT 2004
Hello!
I have a big CSV file, which I must read and do some processing with it.
Unfortunately I can't figure out how to use standard *csv* module in my
situation. The problem is that some records look like:
""read this, man"", 1
which should be decoded back into the:
"read this, man"
1
... which is look pretty "natural" for me. Instead I got a:
read this
man""
1
output. In other words, csv reader does not understand using of "" here.
Quick experiment show me that *csv* module (with default 'excel' dialect)
expects something like
"""read this, man""", 1
in my situation - quotes actually must be trippled. I don't understand this
and can't figure out how to proceed with my CSV file. Maybe some
*alternative* CSV parsers can help? Any suggestions are welcomed.
Vladimir Ignatov
More information about the Python-list
mailing list