Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is possible to obtain the CSV separator from Thread.CurrentThread.CurrentCulture? (.NET)

Tags:

.net

csv

culture

In languages where the decimal separator is a ,(comma) the CSV (comma separated values file format) separator is a ; (semicolon). I know where to find this configuration in the Windows Control Panel, but I don't know how to find it progamatically in a .NET application.

I guess that Thread.CurrentThread.CurrentCulture has that information, but I couldn't find inside it.

like image 361
Jader Dias Avatar asked Jan 05 '09 16:01

Jader Dias


People also ask

How do I find the separator in a csv file?

To do this: Open your CSV using a text editor. Skip a line at the top, and add sep=; if the separator used in the CSV is a semicolon (;), or sep=, if the separator is a comma (,).

What is the default separator in CSV?

csv file, the default list separator (delimiter) is a comma. You can change this to another separator character using Windows Region settings.


1 Answers

System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator

Is the only way I know how.

like image 82
jhunter Avatar answered Oct 12 '22 11:10

jhunter