mcastorina / graph-cli

Flexible command line tool to create graphs from CSV data
783 stars 29 forks source link

Internationalization: Allow configurable options for Field Separator and Decimal Separator #60

Open hattesen opened 1 year ago

hattesen commented 1 year ago

Most European countries use comma as a decimal separator, so PI would appear as 3,14159265 rather than 3.14159265. As a consequence, CSV files cannot use comma as a field separator, and the convention is to instead use semicolon as a field separator, so the sine.csv file would look like:

x;sin(2πx/1000)
0;0,0
1;0,006283143965558951
2;0,012566039883352607
3;0,018848439715408175
4;0,02513009544333748
5;0,03141075907812829
6;0,03769018266993454
7;0.0439681183178649
...

It would be great, if there would be an option to define field separator and decimal separator, or be able to define a locale from which these options could be obtained.

An added bonus would be that TAB separated files could also be supported, where field separator can be set to "\t". TAB separated files often have the .tsv file name extension, which is also supported by GitHub for preview.