Open GoogleCodeExporter opened 8 years ago
It is not only for the quotes. It is for delimiter in general. I tested it with
delimiters like: [",',$] and then I had the delimiter escaped in the values. It
fails for all.
Original comment by razvan.l...@gmail.com
on 7 May 2014 at 12:24
Quotes are escaped in CSV using double-double quotes.
The following works because it's has an even number quotes:
$.csv.toArrays("Testing,Two\n"); /* Works */
This fails because there are an odd number of quotes.
{{{$.csv.toArrays("Testing\",Two\n"); /* Throws an "Illegal Quote" error */}}}
Also fails because there are an odd number of quotes.
{{{$.csv.toArrays("Testing\\\",Two\n"); /* Also throws an "Illegal Quote error"
*/}}}
The following is valid CSV as per the specification:
$.csv.toArrays("Testing,Two\n");
$.csv.toArrays("Testing"",Two\n");
$.csv.toArrays("Testing"""",Two\n");
I know it seems weird that CSV escapes a quote with a quote but that's how the
format is specified.
Original comment by evanpla...@gmail.com
on 29 May 2014 at 3:27
BTW, the examples you posted should result in the following output:
Testing,Two
Testing"",Two
Testing"""",Two
Note: newline characters are assumed to be non-visible in the output.
In JSON equivalent would be:
[
[
"Testing",
"Two"
],
"Testing""",
"Two"
],
[
"Testing""""",
"Two"
]
]
All 3 entries will have 2 cells because you're not containing the comma
separator within a pair of double-quotes.
I hope that clears things up.
Original comment by evanpla...@gmail.com
on 29 May 2014 at 3:31
Original issue reported on code.google.com by
k...@atomicinfotech.com
on 25 Apr 2014 at 5:40