Home  »  Solutions  »  What I've Learned  »  When Dynamically Generating CSV, Don't Forget the Quotes

When Dynamically Generating CSV, Don’t Forget the Quotes

Nate Weiner - Posted in What I've Learned, , , Comments (0)

I was generating CSV files with PHP so that a client could easily export their mailing list from the database when I hit a snag with loading the generated files on a Mac.

I received the error message:

“SYLK: file format is not valid.” when opening the file in Excel on OS X.

To solve the problem, simply make sure all data is enclosed with quotes.

Ex: ‘ID’,'First Name’, ‘Last Name’

Found this on Microsoft’s website: http://support.microsoft.com/kb/323626

Comments


Leave a Reply