[Csv] Proposal: comment character for csv files...
Andrew McNamara
andrewm at object-craft.com.au
Mon Jun 27 05:33:55 CEST 2005
>Iain Haslam submitted a patch for the _csv module to implement comment
>characters for CSV files:
>
> http://python.org/sf/1225769
>
>Basically, you could define a comment character, which, if it appeared in
>column 1, would cause the reader to skip that line.
>
>I'm mildly against the idea (first impression mostly), but the patch isn't
>very big. Would someone else please take a look at it and comment on the
>idea?
SF seems to be down, so I can't review the patch. I can't see any real
downside to the proposal - it's a fairly simple change, and it will be
used. Certainly it can be done other ways, but it strikes me that this
is the best place for it.
The changes to the C code are only part
of the story - doco updates, test updates, etc, are all needed. The
patch probably should also raise an exception if the comment character
conflicts with one of the other special characters (it may already do
this - I can't check at the moment).
What happens if the the comment character appears in a multiline record?
abc,"def
#ghi",jkl
lmn",
--
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/
More information about the Csv
mailing list