比如你的路径是:C:\example.txt
你的表是table1
example.txt内容为:
1,2,3,4
5,6,7,8
...
load data infile 'c:\\example.txt' into table table1 fields terminated by ',' lines terminated by '\n';
如果你的分隔符不是一致的,可以用EDITPLUS等工具的正则替换模式替换成一致的分隔符,然后导入即可。
如果数据格式是这样:
"1","2","3","4"
"5","6","7","8"
...
load data infile 'c:\\example.txt' into table table1 fields terminated by ',' optionally enclosed by '"' lines terminated by '\n'