开发者

Pilcrow appears in all the column values after importing from CSV file - MYsql

开发者 https://www.devze.com 2022-12-13 23:59 出处:网络
my CSV content looks like this 1234,123;123;123 5675,123;567;234;565 No Space is provided at the end of each row in CSV i.e. 1234,123;123;123(No space here)

my CSV content looks like this

1234,123;123;123
5675,123;567;234;565

No Space is provided at the end of each row in CSV i.e. 1234,123;123;123(No space here)

Imported this using the following command

mysql> load data local infile 开发者_StackOverflow'E:\sample.csv' into table Test.Table1 fields 
terminated by ',' lines terminated by '\n' (Column1,Colunm2);

It gets executed successfully and i can find all the records in the DB. But the second column ends with a pilcrow.

When i try to edit, the value looks like

123;123;123
<extra line here>

If i remove the extra line, the pilcrow disappears.

Type of the column1, column2 is varchar.

Any clues for the issue?


I believe your problem is because of EOL termination. The file probably is using \r\n instead of only \n, hence the "<extra line here>".

0

精彩评论

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