* separated values

Magnus Lie Hetland mlh at vier.idi.ntnu.no
Wed Jan 16 17:54:34 EST 2002


In article <mailman.1011133162.29275.python-list at python.org>, Skip
Montanaro wrote:
>
>    Cliff> I've heard (I haven't looked for myself) that Dave's doesn't
>    Cliff> support embedded newlines which is a big killer for many CSV
>    Cliff> files...
>
>I think it does the right thing in this regard.  Given this csv file:
>
>    "abc
>    def",5,qwerty
>
>running a slightly modified version of the test script that comes with the
>package:
[snip]

How odd... I guess I didn't delve deeply enough, but this seems to
contradict the web page:

"""
The parser will raise a csv.Error exception under any of the following
circumstances: 

    [...]
    * If an end of line is encountered which is not at the end of string
"""

I guess this just means that when parsing partial csv files you should
parse one line at a time, right? That seems reasonable. And the not
allowing space outside quotes is OK too, I guess... Or, rather, not
*after* a closing quote. (I'm glad space before an opening quote is
allowed, since I like to put a single space after all my commas,
everywhere ;)

>
>Skip
>


-- 


--
Magnus Lie Hetland                                  The Anygui Project
http://hetland.org                                  http://anygui.org



More information about the Python-list mailing list