0

如何使用 mysql 命令将以下 csv 导入 mysql 表?

##
#File name : proj.csv
 #line 1 are the field headers
 #record 1 starts at line 2, ends at line 583
 #from line 2 "<!DOCTYPE" to line 582 "</html>" are actually text blob of
 #record 1 's "html" field
##

line 1: "proj_name","proj_id","url","html","proj_dir"
line 2: "Autorun Virus Remover",1,"http://www.softpedia.com/get/Antivirus/Autorun-Virus-Remover.shtml","<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN"" ""http://www.w3.org/TR/html4/loose.dtd"">
line 3: <html>
line 4: <head profile=""http://a9.com/-/spec/opensearch/1.1/"">
...
line 582: </html>
line 583: ","Antivirus/Autorun-Virus-Remover"

问题是目标csv文件中有一个文本blob字段(名为“html”,其中包含多行文本),所以我不能使用'\n'作为记录分隔符,否则它会说“第 1 行不包含所有列的数据”。万分感谢 !!!

4

0 回答 0