For a valid CSV formatting, if a field contains a comma then that field must be quoted.
4 separate fields:
Code:
1,2,34,5
2 fields with commas:
Code:
"1,2","34,5"
3 fields, one with a comma:
Code:
1,"2,34",5
If your CSV file is not properly handling literal comma characters like that, it will be very difficult to handle it correctly.
If it is correctly formatted, then we may need to know more about how you're doing the import to make sure it understands how to parse CSV files.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Ah...I wasn't even thinking about the usage of comma as a decimal point. As far as I know, MySQL only recognizes the period (full stop) for that when specifying a float/decimal literal. I don't know if other DBMS's may provide a locale setting or some other way that would allow use of the comma for that. I suppose I'd probably throw together a script that would read the file and convert the comma into those fields to a period.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks