PHP Developers Network
http://forums.devnetwork.net/

Is there a way to include commas in CSV columns without brea
http://forums.devnetwork.net/viewtopic.php?f=6&t=140099
Page 1 of 1

Author:  vinodkumar [ Thu Aug 21, 2014 8:11 am ]
Post subject:  Is there a way to include commas in CSV columns without brea

Is there any way to put commas in csv file.

I've got a two column CSV with a name and a number. Some people's name use commas, for example "Joe Blow, CFA." This comma breaks the entire CSV format.
How to handle this type of cases?Any alternative is there? Please let me know.

Author:  Celauran [ Thu Aug 21, 2014 8:19 am ]
Post subject:  Re: Is there a way to include commas in CSV columns without

Moved because this has nothing to do with Linux.

Wrapping your columns in quotes should prevent problems caused by commas in your values. You could also use a different separator.

Author:  pickle [ Fri Aug 22, 2014 10:24 am ]
Post subject:  Re: Is there a way to include commas in CSV columns without

Re: escaping: The standardized practice is to escape double quotes with double-double quotes:

42,"Joe ""The Blowman"" Blow, CFA.",100.0

http://www.ietf.org/rfc/rfc4180.txt, search for "double quotes"

Author:  requinix [ Fri Aug 22, 2014 12:31 pm ]
Post subject:  Re: Is there a way to include commas in CSV columns without

If you're writing the CSV using PHP then use , which will deal with the quote thing for you.

Author:  Tayla6 [ Fri Aug 29, 2014 8:07 am ]
Post subject:  Re: Is there a way to include commas in CSV columns without

I am not sure if there is any way to use commas in a csv file.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/