开发者

(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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜