'Importing Data from CSV file into MySQL, Scientific Notation
I am using a LOAD DATA INFILE to read from a CSV and insert into a MySQL table. The problem is that one column in the CSV is in scientific notation and when it is read and loaded into the table it won't go into a column of type DOUBLE, FLOAT, or REAL. Is there a solution to this?
114,2015-05-11 00:00:00.000,0,100,14,2.576927E+10,1.730594E+10,1.904524E+10,1.788426E+10,69.40149
In this one row of the CSV are the scientific notation values that when loaded via LOAD DATA INFILE just become 100000
Solution 1:[1]
load DATA local infile yourfile INTO TABLE Direction_Prix_proxi.tmp_prix_conc FIELDS TERMINATED BY ';' LINES TERMINATED BY '\r\n' (@yourcolumn) set yourcolumn = REPLACE(@yourcolumn, ',', '.')
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Malou |
