Re: Import multiple CSV files in one Mysql table.
1. I think the bast way is to split the CSV accroding to your needs befor importing into different files named according to the tables to be imported, e.g.:
head -n -10 a.csv > A.csv
tail -n +10 | head -n 20 > B.csv
etc.
then use the mysqlimport statement like the one below with multiple input files:
mysqlimport ... A.csv B.csv ...
2. Try this:
mysqlimport --fields-optionally-enclosed-by="\"" --fields-terminated-by=, --lines-terminated-by="\n" --user=<username> --password <db_name> --local --ignore-lines=1 ./<table_name>.csv
Input file format:
"id","name"
"1","name1"
"2","name2"
where line 1 is fields caption.
---------------
StarWind Software developer (
http://www.starwindsoftware.com )