Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

load data infile, comment character

I have a data file where some rows are comment lines starting with %. How to load data from such a file into a mysql table?

like image 482
suresh Avatar asked Jul 21 '26 04:07

suresh


1 Answers

Ah. No. From the spec for the command there is no way to get it to ignore lines starting with a specific character. You can skip a certain number of lines, but that's the best you can do.

You'll want to preprocess the file. Or tell whoever is generating it to stop putting that in place.

like image 176
Femi Avatar answered Jul 23 '26 17:07

Femi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!