3

I'm writing an iOS 8 app that allows you to export data to be sent as an email attachment. Currently, I'm exporting the data to a CSV file with 7 columns and x number of rows. When I first created it, I used a comma for delimiter, but that wasn't automatically detected by Excel - so I had to go to data-import as so on to read it correctly. I later changed it to a semicolon, and now it reads correctly in Excel as well by simply double-clicking the file, but I'm not sure if this is the optimal delimiter.

What I need to know is what delimiter I should use that can be read by the majority of spreadsheet readers (including Excel) simply by double-clicking the file.

Arjan
  • 31,511
Erik
  • 151

2 Answers2

2

What delimiter should I use that can be read by a majority of spreadsheet readers?

Short Answer:

There is no general solution to this problem.

Long Answer:

You haven't defined majority.

There is no real answer to this question as it depends on how the email recipient has configured their computer's regional settings and excel settings.

If you can answer all of the following questions then only you can decide what the appropriate delimiter should be:

  • Who is going to use your app and what country are they in?
  • Who are the users of your app going to email?
  • What countries are the email recipients in?
  • How do they have their regional settings configured?
  • How do they have their spreadsheet configured?
  • Can their computer even open a speadsheet by double clicking?
DavidPostill
  • 162,382
0

You just have to add the line 'sep=,' (or 'sep=;' if you want to use ;) at the top of your csv document. Excel will use then the defined character as separator.