I have data that has fields deliminated by \u0001
and records deliminated by \u0002\n
. I want to use LOAD DATA INFILE
to import all of the data at once into a MySQL database. I know that \u0001
can be written as X'01'
, but I am not sure how to write `\u0002\n'.
This is what I have so far.
LOAD DATA LOCAL INFILE 'myfile.txt' INTO TABLE my_table
FIELDS TERMINATED BY X'01'
LINES TERMINATED BY '\n'
(col1, col2, col3);
The above SQL statement works but I'm afraid that the \u0002
might be imported into the database along with the data.
I know that \u0002
can be written as X'02'
but I'm not too sure how I can combine X'02'
with \n
.
Any suggestions?