Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: SQLLDR Question
Instead of trying to do this in SQL Loader, why not just try to clean up the data?
This can be done at least 2 methods:
The following Perl script will do it
Jared
my $file="data.txt";
open(DATA,$file) || die "cannot open $file - $!\n";
while(<DATA>){
chomp; my @data = split(/,/); # append last field to penultimate field, remove last field $data[ $#data -1] .= "-" . $data[ $#data ]; undef $data[ $#data ]; #print it all out my $newData = join(',',@data); # remove trailing comma chop $newData; print "$newData\n";
On Wednesday 23 May 2001 14:41, Scott Canaan wrote:
> I am trying to load a file that has the fields comma-delimited,
> variable length. A sample line from the file looks like this:
>
>
>
>
>
> This is on Oracle 8.1.6.0 on Sun Solaris.
>
>
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Jared Still INET: jkstill_at_cybcon.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Wed May 23 2001 - 21:27:24 CDT
![]() |
![]() |