RE: LOAD DATA INFILE and how to ignore garbage lines at end ofload file?
Just use delimiters in Oracle... then use same delimiters on the import... simple any lines or blank spaces etc would be ignored. Also turn feedback off in Oracle so you don't get all the headers etc... -Original Message- From: Paul DuBois [mailto:[EMAIL PROTECTED]] Sent: 04 March 2002 16:33 To: Richard Bolen; MySQL Mailing List (E-mail) Subject: Re: LOAD DATA INFILE and how to ignore garbage lines at end ofload file? 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/ - 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 - 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
Re: LOAD DATA INFILE and how to ignore garbage lines at end ofload file?
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/ - 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
RE: LOAD DATA INFILE and how to ignore garbage lines at end ofload file?
I added the line set feedback off at the beginning of my Oracle report script and that suppressed the output of the garbage lines. -Original Message- From: Paul DuBois [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 11:33 AM To: Richard Bolen; MySQL Mailing List (E-mail) Subject: Re: LOAD DATA INFILE and how to ignore garbage lines at end ofload file? 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/ - 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