You are viewing an old revision of this post, from May 1, 2015 @ 01:11:05. See below for differences between this version and the current revision.

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! [php]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."[/php]

Revisions

  • May 1, 2015 @ 01:11:05 [Current Revision] by PeterLugg
  • May 1, 2015 @ 01:11:05 by PeterLugg

Revision Differences

There are no differences between the May 1, 2015 @ 01:11:05 revision and the current revision. (Maybe only post meta information was changed.)

Tags:

No comments yet.

Leave a Reply