Antoine wrote:
> 
> Richard Trahan wrote:
> > I'm using 3.23.49 on Windoze 98. I'm trying to execute this:
> >
> > mysqlc> load data local infile "c:/temp/e-headhunters.txt"
> >       -> into table headhunters
> >       -> lines terminated by '\r\n'
> >       -> (email);
> >
> > Table headhunters contains several fields, including
> >  'email varchar(40)'.
> >
> > The input file is text, with lines terminated by x'0d0a', confirmed
> > with a hex editor. It contains simple strings:
> >
> > ilsglobe.com
> > baxley.com
> > ComputerJobs.com
> > coloradojobs.com
> > dice.com
> 
> I suspect MySQL opens the file in text mode (default under windows),
> in which case '\r\n' occurences would be replaced by '\n' alone
> (or, alternatively, '\n' means "0x0D,0x0A" in itself). The warnings
> probably relate to the fact that further concatenating the other
> lines would break your 40-character limit for 'email').
> 
> So I suggest you try to change your separator :
> 
> mysqlc> load data local infile "c:/temp/e-headhunters.txt"
>         -> into table headhunters
>         -> lines terminated by '\n'
>         -> (email);
> 
> Or maybe, instead of '\n', specify the hex value (maybe '\0x0a').
> 
> Good luck
> 
> Antoine.

Wow, that was quick. No lack of help here!

Well, I tried both of your suggestions. This is very strange.
Changing to LINES TERMINATED BY '\n' still input one record,
only email contained only the first input line (ilsglobe.com),
but I bet it had a trailing <cr>. Warnings were issued for
the rest (there are 23 input lines).

Changing the line terminator to \0x0a also resulted in one
record, only this time it consists of 3 three input lines,
with embedded <nl> (possibly <cr><nl>), and only 1 warning!

I suspect a bug here. I think it's trying to stuff everything into
the email field because it doesn't take a line terminator as
a field terminator as well. Or maybe it doesn't recognize the
field name enumeration following a LINES TERMINATED BY clause.

---------------------------------------------------------------------
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