Properly escaping a double quote in CSV 
Amazing trick. This is one of the first thing to try if your CSV spreadsheet is not rendering how you expect.

Original Question:
======================================================
I have a line like this in my CSV:

"Samsung U600 24"","10000003409","1","10000003427"

Quote next to 24 is used to express inches, while the quote just next to that quote closes the field. I'm reading the line with fgetcsv but the parser makes a mistake and reads the value as:

Samsung U600 24",10000003409"

I tried putting a backslash before the inches quote, but then I just get a backslash in the name:

Samsung U600 24\"

Is there a way to properly escape this in the CSV, so that the value would be Samsung U600 24" , or do I have to regex it in the processor?
======================================================


Answer:
======================================================
Use 2 quotes:

"Samsung U600 24"""
======================================================

http://stackoverflow.com/questions/1780 ... ote-in-csv

[ view entry ] ( 1507 views )   |  print article

<<First <Back | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | Next> Last>>



2024 By Angel Cool