List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 4 2002 4:33pm
Subject:Re: LOAD DATA INFILE and how to ignore garbage lines at end of
load file?
View as plain text  
At 10:58 -0500 3/4/02, Richard Bolen wrote:
>I'm exporting data from Oracle and importing it into MySQL.  The 
>problem is Oracle puts garbage lines at the end of it's output files.

As you've noted, the problem is Oracle.

If you're using Unix, you could use tail to see how many of these lines
there are and wc to count the total number of lines in the file.  With
that information, you can construct the proper value of n and use head -n
to get only the initial part of the file that contains the non-garbage lines.

Or you could reverse the order of the lines in the file (expensive?) and
then use IGNORE n LINES in your LOAD DATA statement to ignore the first n
lines.

Better if you can get Oracle just to suppress these lines in the first
place.  Perhaps someone else will have a suggestion how to do that.

>   Lines like "300 rows selected" and "input truncated to 9 chars" as 
>well as empty lines.  When MySQL loads these files, I'm getting rows 
>inserted for the empty lines at the end of these files. 
>
>Can I get MySQL to ignore empty lines at the end of these files?  or 
>if anyone has Oracle experience can I get it to suppress the output 
>of these line?
>
>Thanks,
>Rich
>
>--------------------------------------------------------------------
>Rich Bolen
>Senior Software Developer
>GretagMacbeth Advanced Technologies Center
>79 T. W. Alexander Drive - Bldg. 4401 - Suite 250
>PO Box 14026
>Research Triangle Park, North Carolina 27709-4026  USA
>Phone:  919-549-7575 x239,  Fax: 919-549-0421
>
>http://www.gretagmacbeth.com/
>--------------------------------------------------------------------

Thread
LOAD DATA INFILE and how to ignore garbage lines at end of load file?Richard Bolen4 Mar
Re: LOAD DATA INFILE and how to ignore garbage lines at end ofload file?Paul DuBois4 Mar
  • Re: LOAD DATA INFILE and how to ignore garbage lines at end of load file?David Turner4 Mar
RE: LOAD DATA INFILE and how to ignore garbage lines at end ofload file?Richard Bolen4 Mar
RE: LOAD DATA INFILE and how to ignore garbage lines at end ofload file?Dominic Baines5 Mar