brianLikeApple
brianLikeApple

Reputation: 4371

Programmatically generated CSV file format issue for Excel and Numbers

In my iOS project, I have programmatically generated csv file from my data. Most of time, it looks all good for Microsoft Excel and Apple Numbers to open with.

But when the cell data is something like 5 - 60, it seems Excel would automatically convert it to date value like May-60, while Numbers open it correctly.

I have found this thread: https://stackoverflow.com/a/165052/833885, so the solution makes Excel happy is using "=""5 - 60""". But this will make Numbers shows ="5 - 60"......

You can quickly generate empty csv file to test what I described above.

Is is possible to generate csv file that makes all world happy???

Thanks in advance.

Upvotes: 0

Views: 348

Answers (1)

Lee Cordell
Lee Cordell

Reputation: 276

You can create a new file in excel and import from the data ribbon tab - this gives options to specify the data types for 'columns' in the csv. A bit of a pain but will avoid the issue.

Upvotes: 1

Related Questions