MySQL导入csv只获得一半的行

时间:2012-03-22 16:58:59

标签: mysql csv import

我使用以下命令读取csv:

LOAD DATA INFILE '/Users/Tyler/Desktop/players_escaped.txt' 
INTO TABLE players
FIELDS TERMINATED BY ',' 
ENCLOSED BY '^'
LINES TERMINATED BY '\n';

csv看起来像这样:

^1^,^False^,^False^,^Ovie^,^Soko^,^6^,^8^,^210^,^^,^M^,^London^,^^,^^,^^,^^,^0^,^2009^,^^,^False^,^False^,^{299F909C-88D9-4D26-8ADC-3EC1A66168BB}^,^844^,^2013^,^^,^^,^0^,^^,^^,^2011-02-16 20:53:34.877000000^,^^,^2011-02-16 20:53:34.877000000^,^^,^^,^^,^^,^^,^^,^^,^^,^^,^1^,^2^,^^,^^,^^,^^,^^,^^,^^,^^,^^,^^
^2^,^False^,^False^,^Jordan^,^Swing^,^6^,^6^,^200^,^^,^M^,^Birmingham^,^AL^,^35218^,^^,^^,^0^,^2009^,^^,^False^,^False^,^{299F909C-88D9-4D26-8ADC-3EC1A66168BB}^,^844^,^2013^,^^,^^,^0^,^^,^^,^2011-02-16 20:53:34.877000000^,^^,^2011-02-16 20:53:34.877000000^,^^,^^,^^,^^,^^,^^,^^,^^,^^,^1^,^2^,^^,^^,^^,^^,^^,^^,^^,^^,^^,^^

我还尝试\作为分隔符并得到了相同的结果。

我只得到奇数行。

csv中有250k记录。

由于

1 个答案:

答案 0 :(得分:2)

您是否检查过.txt文件的行结尾?