On Aug 4, 1:01 am, John Machin <[EMAIL PROTECTED]> wrote:
> On Aug 4, 5:49 pm, Ryan Rosario <[EMAIL PROTECTED]> wrote:
>
>
>
> > Thanks Emile! Works almost perfectly, but is there some way I can
> > adapt this to quote fields that contain a comma in them?
>
> You originally said "I have a very large CSV file that contains double
> quoted fields (since they contain commas)". Are you now saying  that
> if a field contained a comma, you didn't wrap the field in quotes? Or
> is this a separate question unrelated to your original problem?

I enclosed all text fields within quotes. The problem is that I have
quotes embedded inside those text fields as well and I did not double/
escape them. Emile's snippet takes care of the escaping but it strips
the outer quotes from the text fields and if there are commas inside
the text field, the field is split into multiple fields. Of course, it
is possible that I am not using the snippet correctly I suppose.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to