I'm using the below query to insert data from csv into mysql in shell script.I neeed to remove the first line ie,the header names while inserting without mentioning their names
for _csv_file in ${_csv_files[@]}
do
export IFS=","
cat $_csv_file | while read a b c d e f g h i j k l m n o p q r s t u v; do mysql -u $_db_user -p$_db_password $_db << eof
INSERT INTO \`csv_temp_table\`
(\`ProductType\`,\`ProductTypea\`,\`ProductTypeb\`,
\`ProductTypec\`,\`ProductTyped\`,\`ProductTypee\`,
\`ProductTypef\`,\`ProductTypge\`,\`ProductTypeh\`,
\`ProductTypeh\`,\`ProductTypej\`,\`ProductTypke\`,
\`ProductTypel\`,\`ProductTypem\`,\`ProductTypen\`,
\`ProductTypeo\`,\`ProductTyppe\`,\`ProductTypeq\`,
\`ProductTyper\`,\`ProductTypes\`,\`ProductTypet\`,
\`ProductTypeu\`) VALUES ('$a','$b','$c','$d','$e','$f','$g','$h','$i',
'$j','$k','$l','$m','$n','$o','$p','$q','$r','$s','$t','$u','$v',);
eof
done
done
exit;
Please help me accomplish that.Thank you.
cat $_csv_filebytail -n +2 $_csv_file?$_csv_file->"$_csv_file",${_csv_files[@]}->"${_csv_files[@]}"etc.