MySQL Forums
Forum List  »  Oracle

LOAD DATA INFILE OF A WINDOWS CSV FILE
Posted by: Roberto B.
Date: December 26, 2015 05:56AM

I have a windows csv file containing a list of fileaddresses, each one on a single row.
I must load it by LOAD DATA INFILE into a simple table having just one column.
Using:


SET sql_mode='NO_BACKSLASH_ESCAPES';
LOAD DATA LOCAL INFILE 'C:/searchresult.csv'
INTO TABLE ltable
FIELDS TERMINATED BY '\r\n'
LINES TERMINATED BY '\r\n'
(FILEADDRESS);


And all the ways (combinations of FIELDS and LINES sections, also excluding it/them, and with different termination codes '\n','\r','\r\n','\t') i have tried i was unable to exclude ASCII 13 i've got at the end of each row. Also following the suggestions in https://dev.mysql.com/doc/refman/5.5/en/load-data.html.
Particurarly, the use of LINES TERMINATED BY '\r\n'
leads to get just a single value imported and consisting in just all the original rows appended each other with a ASCII(13) between each original value.
How can avoid to import that last character?

Options: ReplyQuote


Subject
Views
Written By
Posted
LOAD DATA INFILE OF A WINDOWS CSV FILE
9598
December 26, 2015 05:56AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.