Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple values for one field in comma-separated values .csv format

Tags:

csv

Is it possible to have multiple values under the same field in a .csv file?

I have an "email" field on my webpage, and the user may optionally type in multiple addresses. I want my .csv file to be able to handle an arbitrary number of "email" values. How can I achieve this? The .csv is read by a third party program which I cannot modify.

like image 709
matskn Avatar asked Oct 04 '10 08:10

matskn


1 Answers

Yes. You can have multiple values in one filed of a CSV file.

If the multiple values are separated by space you need not do anything special but if the values are separated by a comma, you need to enclose the entire field in double quotes.

Example:

Name,E-mail    
foo,[email protected] foo [email protected]
bar,"[email protected],[email protected]"
like image 117
codaddict Avatar answered Oct 19 '22 21:10

codaddict