MySQL has a nice CSV import function LOAD DATA INFILE
.
I have a large dataset that needs to be imported from CSV on a regular basis, so this feature is
You can use LINES STARTING to separate usual line endings in text and a new row:
LOAD DATA LOCAL INFILE '/home/laptop/Downloads/field3-utf8.csv'
IGNORE INTO TABLE Field FIELDS
TERMINATED BY ';'
OPTIONALLY ENCLOSED BY '^'
LINES STARTING BY '^'
TERMINATED BY '\r\n'
(Id, Form_id, Name, Value)
For usual CSV files with " enclosing chars, it will be:
...
LINES STARTING BY '"'
...