Stopping Excel Date Parsing

By : HughieW

I've written a script to export product data from a cscart database to a CSV file. It works perfectly, however when opened in MS Excel, it parses things such as "12-14" as dates, which shows "Dec 14".

I read but the client will not be willing to do that - is there any other way in the CSV file itself to force Excel to recognise it as a string.

I've tried wrapping all fields in double quotes, I've tried putting spaces around the hyphen - no luck. Any ideas?

By : HughieW


I tried this out by putting a single quote and it worked. The sample data I used was





However in the String is now displays when opened in XLS as '12-1, not something very nice, but an easy solution.

By : Dheer

This video can help you solving your question :)
By: admin