PDA

View Full Version : [all variants] dots and commas



jmvidalvia
February 12th, 2011, 09:19 PM
Hi!
I just set a new server.
I am importing csv files to mysql, but get errors because my system understands dots as decimal separators, and commas as thousands separators, when I need them in the opposite way.
How can I change this behaviour?
My locales are LANG=es_ES.UTF-8
Thanks a lot.

Vegan
February 12th, 2011, 10:50 PM
you will need to use C++ and data.getline() type functionality and parse it manually

Vegan
February 12th, 2011, 10:50 PM
C++ can connect to MySQL and then you can upload the data as needed

jmvidalvia
February 13th, 2011, 12:17 AM
Thank you.
But I am afraid neither I am skilled enough nor have time to start learning C++ now. :(
Will use following script before importing my data:

sed 's/,/./g' <infile >outfile
Fortunately the file doesn't have other commas than those in the numbers...