(MySQL) Ignore lines with a starting symbol when importing a file
I have an input file I want to load into a MySQL database, but spread throughout the file are comment lines, which start with !
. For开发者_如何学编程 example,
!dataset_value_type = count
The other lines that I want to read into the table are normal, without the leading !
.
What is the import command to ignore lines that start with !
? I just see commands to ONLY take lines that start with something (LINES STARTING BY
)
Ouch! I think you will need to pre-process your data file. Something like:
perl -pi.bak -e 's/^!.*$//;' data-file.dat
精彩评论