How should I escape commas and speech marks in CSV files so they work in Excel?

Taken from Stack Exchange: http://stackoverflow.com/a/12473481/2821561

We eventually found the answer to this.

Excel will only respect the escaping of commas and speech marks if the column value is NOT preceded by a space. So generating the file without spaces like this … … fixed the problem. Hope this helps someone!

Reference,Title,Description 1,"My little title","My description, which may contain ""speech marks"" and commas." 2,"My other little title","My other description, which may also contain ""speech marks"" and commas."

Revisions

Tags:

No comments yet.

Leave a Reply