List:General Discussion« Previous MessageNext Message »
From:Anthony Ball Date:December 18 2013 4:07pm
Subject:LOAD DATA INFILE with space after quote but before comma
View as plain text  
I ran across a curious issue, I'd call it a bug but I'm sure others would
call it a feature.

I have a csv file with space between the " and , and it causes MySQL to eat
that field and the field after it as a single field. Is there a setting I
can use to remedy this or do I just have to make sure no whitespace
intrudes?

Here is an example:

"testa" ,"testb"



create temporary table testa (a char(15), b char(5)); LOAD DATA LOCAL
INFILE '/tmp/test.csv' INTO TABLE testa FIELDS TERMINATED BY ',' OPTIONALLY
ENCLOSED BY '"';



Data in table is

mysql> select * from testa;
+----------------+------+
| a              | b    |
+----------------+------+
| testa" ,"testb | NULL |
+----------------+------+

Thread
LOAD DATA INFILE with space after quote but before commaAnthony Ball18 Dec
  • Re: LOAD DATA INFILE with space after quote but before commaDhaval Jaiswal19 Dec
  • Re: LOAD DATA INFILE with space after quote but before commahsv19 Dec