Please describe your problem/bug/idea below:

CSV does not properly handle quotes

7 votes
Vote
Sign in
Signed in as (Sign out)
You have left! (?) (thinking…)
youknowwho4evayouknowwho4eva shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

5 comments

Sign in
Signed in as (Sign out)
Submitting...
  • mctriviamctrivia commented  ·   ·  Flag as inappropriate

    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"""

  • mctriviamctrivia commented  ·   ·  Flag as inappropriate

    any word? i know low votes but i provided the code needed to fix the bug

  • mctriviamctrivia commented  ·   ·  Flag as inappropriate

    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);

Feedback and Knowledge Base