tags:

views:

24

answers:

2

Hi all. I wonder if there is any way to generate culture neutral CSV file or at least specify data format of certian columns present in file. For example I generated CSV file that contains numbers with decimal separator (.), and after pass it to the client which is in the country where decimal separator is (,), client opens it with Excel and sees all values changed. Is there any way to resolve this isure, or just in this case do not use CSV file ? Thank you in advance.

+2  A: 

What you want is a "quoted CSV file".

That is as well as separating your values with commas you also enclose them in (usually) double quotes.

Like so:-

"first","second","3,00","Some other text, etc."

This format is quite common and supported by EXCEL.

James Anderson
Seems that I MUST use (,) like separator in this case and Excelwill threat the cell like General formatted.
Tigran
A: 

A CSV file will be separated by commas (the 'C' in CSV) but you can output a text with any delimiter and qualifier and you'll be able to open it in Excel - you specify them in the step 2 of the import text wizard.

A common choice for situations like this is to use tabs (TSV).

FinnNk