I'm trying to load a text file that contains just one column of data. The file was made in Windows so each line is terminted by '\r\n'. I verified this by looking at the file in a hex editor. I'm using Load Data to get it into my MySQL database, but it's not working. Here's what I'm entering:
LOAD DATA INFILE 'test.csv' INTO TABLE PHONE_NUMBERS LINES TERMINATED BY '\r\n';
It'll say duplicate entry at key 1. Is my syntax incorrect?
My friend wrote a C++ program that reads in the file line by line and then prints it out with a \n, but it stills adds the \r for some reason. If I change it to tabs, I get the same error in MySQL (lines terminated by '\t' doesn't work). Any ideas?
LOAD DATA INFILE 'test.csv' INTO TABLE PHONE_NUMBERS LINES TERMINATED BY '\r\n';
It'll say duplicate entry at key 1. Is my syntax incorrect?
My friend wrote a C++ program that reads in the file line by line and then prints it out with a \n, but it stills adds the \r for some reason. If I change it to tabs, I get the same error in MySQL (lines terminated by '\t' doesn't work). Any ideas?