Writing out comma separated values in a single cell in spreadsheet

11417
21
Jump to solution
04-24-2015 10:56 AM
benberman
Occasional Contributor

Please excuse the long subject header. I have gotten pretty good at writing data out to csv files but i seem to have stumbled into this block. Anytime a ',' (comma) is used to join values, it shifts over to the next cell in the spreadsheet. What I want to accomplished is for example:

Inside a single cell, write out cat,dog,mouse

Already checked the csv module in python docs and nothing immediately jumped out at me.

any ideas?

Tags (3)
21 Replies
benberman
Occasional Contributor

Good grief. For crying out loud, man....I would encourage you to read posts more closely: Simply wrapping double quotes around the string will not work.

What you have illustrated in your example is nesting quotes within quotes.

0 Kudos
DanPatterson_Retired
MVP Emeritus

Yup...single,double,double,single...works every time. that is how it is done...and that is what the csv reader does and as Robert showed.

similar advice was given on the GIS Stack Exchange site, however, further commentary there has been closed as off topic.  In any event, have a good look at the csv reader and its operation would be my advice to others.

0 Kudos