[Tutor] Writing to CSV string containing quote and comma

Joel Goldstick joel.goldstick at gmail.com
Mon Dec 9 22:57:50 CET 2013


On Mon, Dec 9, 2013 at 4:52 PM, J Sutar <jsutar at gmail.com> wrote:

> # Re-sending from registered email address #.
>
> Hi,
>
> Posting for first time so hope I get the forum etiquette and rules right,
> please let me know otherwise.
>
> I'm trying to write to csv a string which contains double quotation marks
> and a comma however I'm finding that the write reads the comma as a
> delimiter. If try wrap the string around double quotes it clashes with the
> raw quotes originally within the string text (which I'd like to/must
> preserve). Replacing double quotes with single quotes is neither an option
> as I may have text containing single quotes (as in the number four example
> below).
>
> Python has a csv reader and writer module.  You should check it out.
>
>
> A helping hand on this would be very much appreciated.
>
> Thanks in advance.
> Jignesh
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
>


-- 
Joel Goldstick
http://joelgoldstick.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20131209/f0d244cc/attachment-0001.html>


More information about the Tutor mailing list