CSV does not properly handle quotes
I just received confirmation that this is on the ‘high priority’ list of bugs now. [bart]
5 comments
-
mctrivia
commented
just verified still does not work. To test make a model with a quote in the name and then export the csv. The proper way to handle items with quotes is to put the entire field in quotes then doiuble quote the quote.
so
d"f
becomes
"d""f"and
df"
becomes
"df""" -
Adminbartv
(Admin, Shapeways)
commented
Hi guys,
could you please indicate which CSV function has this problem and verify if it's still an issue?
Thanks,
Bart
-
mctrivia commented
any word? i know low votes but i provided the code needed to fix the bug
-
mctrivia commented
it is hard to say for sure without knowing the method you are using to generate the csv file. what I do know is you are not using the built in csv generator: fputcsv ( http://php.net/manual/en/function.fputcsv.php ). look it up. Not only will it make csv generation faster, but it will automatically handle all the querky situations.
if you must sercum navigate php`s built in systems then the following line executed on the title filed before export should fix the bug
$title=str_replace(`'"','""',$title);
-
Adminbartv
(Admin, Shapeways)
commented
Is that the CSV import function?