On Friday 21 June 2002 08:31, Roger Baklund wrote:
> * Podhorski, Adam

use the perl "chomp()" function... It strips off any sort of "newlinish" 
trash at the end of the line, then explicitly tack a '\n' onto the end before 
you feed it to MySQL. Esp on windows machines this is a good idea, newlines 
there tend to end up being who-knows-what...

>
> > If I don't put the tab before the the end of the line in the txt file
> > that contains the data, mySQL does not properly put the data into table
> > using LOAD DATA INFILE.
>
> [...]
>
> > But if there is only a \n at the end of the line (e.g.
> > 1\tTC446696\tTC27867\n), the data gets corrupted and even the display
> > does not proerly work (note the wrong vertical column bars for display)
> >
> > mysql> SELECT * FROM tigr_mgi_tcs;
> > +----+----------+------------+
> >
> > | ID | TC       | TC_Synonym |
> >
> > +----+----------+------------+
> >
> >    | | TC446696 | TC27867
> >    | | TC446696 | TC37198
> >    | | TC446696 | TC39544
> >    | | TC446696 | TC70404
> >
> > +----+----------+------------+
>
> It seems as your file have \r\n line endings, not only \n. This can happen
> if the file is produced on a windows machine, or if it has been edited in a
> text editor and saved on a windows machine.
>
> Try using LINES TERMINATED BY '\r\n'

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to