I\'ve got a CSV file with 11 columns and I have a MySQL table with 9 columns.
The CSV file looks like:
col1, col2, col3, col4, col5, col6, col7, col
step1.deal with awk.
cat file.txt |awk '{print $1,$2,$5...}'>new_file.txt
step2.load into mysql.
load data local infile 'new_file' into table t1(...)
the method below is simple,but not allowed in lower version of mysql.
LOAD DATA INFILE 'file.txt'
INTO TABLE t1 (column1, @dummy, column2, @dummy, column3);