Nov 1, 2018

How to Create database table structure from CSV file and then import it to the new table

Create database table structure from CSV file

A good solution is to use csvsql from csvkit, such as

csvsql -i mysql ../csvs/*.csv
csvsql --db mysql:///test --table i88ca --insert data.csv

This is a better solution than http://en.positon.org/post/Import-CSV-file-to-MySQL linked from http://dev.mysql.com/doc/refman/5.7/en/load-data.html