Skip to content
Advertisement

How to write a value that contains a comma to a csv file?

I have a javascript program to write values to a csv file. I have a value that includes comma within. How to do this? I am newbie to javascript. can you please help me?

I tried double quotes

JavaScript

record.assets is the field that will have comma within.

Advertisement

Answer

Close them in quotes and escape double quotes?

http://en.wikipedia.org/wiki/Comma-separated_values

1999,Chevy,”Venture “”Extended Edition”””,4900.00

in your case:

JavaScript

should be

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement