Archived Forum Post

Index of archived forum posts

Question:

CSV file with single double-quote

Jun 19 '12 at 09:11

I have a CSV file, the fields are delimited with commas and double quotes, but sometimes a field will have a single double quote. How do I get the chilkat CSV function to read this in correctly?

The sample I have is

"Code","Quantity","Description"

"ABC123","4","40" HD TV"

I have tried escaping the single double quote but this has not helped. How can I import this as I want?


Answer

A double-quote that occurs within a double-quoted string should be represented as a pair of double quotes, like this:


"Code","Quantity","Description"
"ABC123","4","40 ""HD TV"


Answer

For more information about CSV standards, see http://en.wikipedia.org/wiki/Comma-separated_values