title: Create csv immediately recognizable by Excel (both US and EU)
body: <p>In many EU countries a comma ',' is used as the decimal separator, whereas in the US a dot '.' is used.</p>
  
  <p>CSV (Comma Separated Values) files are supposed to use the comma to separate cell values. However, often a tab '\t' or other characters are used instead.</p>
  
  <p>What's interesting, Excel if you save a .csv file using Microsoft Excel in a EU country using the comma as a decimal separator, the value it uses to separate cell values is not an escaped comma, but a semicolon ';'. Looking on the net it seems that, if you are in the US, Excel will save .csv files using a proper comma (I can't verify this).</p>
  
  <p>I'm trying to find a way to create a csv file that can be recognized by Excel without any user action, both in the EU and the US.</p>
  
  <p>Here's an example using Excel with an Italian locale</p>
  
  <p><img src="https://i.stack.imgur.com/qGRnL.png" alt="Excel cell test"></p>
  
  <p>The above, saved as .csv (MS-DOS), translates to</p>
  
  <pre><code>foo;foo bar;
  foo'bar;"foo""bar";
  foo,bar;foo.bar;
  foo:bar;"foo;bar";
  foo/bar;foo\bar;
  "foo
  bar";foo|bar;
  foo;bar;foobar
  
  this is to make the empty line appear
  </code></pre>
  
  <p>It may be possible that, depending on the local "list separator", this may not be recognized correctly.</p>
  
  <p><a href="https://stackoverflow.com/questions/17953679/how-to-correctly-display-csv-files-within-excel-2013">I've read</a> that the new Excel 2013 needs <code>sep=;</code> to be set as the first line in order to work correctly. This is an ugly hack, but it seems to also be working for Excel 2010 (except it gets overwritten on save)...</p>
  
  <p>Does the above text work for you, if you save it as a csv?</p>
  
  <p>Is there a less hacky way to tell Excel which character is the cell separator, without having the user to set things up?</p>
  
  <p>Thanks.</p>