running mysqlimport under windows on files written in unix - newline character issues

andieje used Ask the Experts™

I am using mysqlimport to import files into mysql under windows. I don't know what operating system the files were created. They  look like tab delimited files in notepad but I notice they contain the \N character a lot. Here is some data from the file

2      2007-11-22 09:44:41      RepeatMask      repbase      \N      repbase      RepeatMasker      3.1.8

 I am guessing the files were written in unix and the \N is an end of line character. Will mysqlimport running on windows interpret the \N as a new line? Perhaps I need to use a flag in the import command? I know there are some flags to handle end of line characters.

What does the -L flag do? The manual says it means 'read all input through the client'
Is that flag relevant to this issue?

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
theGhost_k8Database Consultant

-L will specify that the file is residing locally on client side.

You should use --lines-terminated-by='\N' option to specify the line separator.
Apparently the "\N" is how NULL is represented in a table dump.  It does
not mean newline.


I answered my own question

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial