Yesterday after exporting some data from one of my WordPress site to CSV I got a rude shock after trying to open the file with Excel.
According to it, apparently the file was not a CSV but a SYLK File. The specific error was as follows:
Excel has detected ‘file.csv’ is a SYLK file, but cannot load it. Either the file has errors or it is not a SYLK file format. Click OK to try to open the file in a different format.
Warning thrown by Excel
Now I was certain the file was a CSV since I had exported it using WP Export All. A quick search online unearthed this blog post which indicated that Excel was actually the problem.
Reason: if the first cell on a CSV starts with ID, Excel just assumes you are trying to open a SYLK File.
Fixing the Error without Rendering the CSV Unusable
From that post, it’s self-explanatory that in order to fix the error, we only need to change the ID text with a different text. The problem with that however is if that we may run into issues when we try to use that CSV elsewhere where the first cell has to start with ID.
That precisely was my situation, as I needed to import the CSV back into WordPress after I was done editing it. Fortunately, I did find a workaround after contemplating using a different CSV editor.
So it’s pretty simple, do the following:
- Open the CSV with a plain text editor like Notepad and change ID into some text that doesn’t start with ID e.g temp
- Save the CSV then open it with Excel. This time it won’t throw you the SYLK file error. Do your editing and save the CSV.
- Open the CSV with the plain text editor again and change the edited text back to ID. Save the file and that’s it!
Cheers!
Thank you! So useful.
You’re most welcome!
Sylk file to csv file
Found this post and figured there must be a solution so I just tried putting quotation marks around ID when I edit it in the plain text editor so you end up with:
“ID”,Column1,Column2
Excel doesn’t show the quotation marks as they’re used to enclose any cell that needs to display a comma in a CSV file.
Thanks for sharing that tip.