Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: sqlldr help
Sounds like a job for Perl.
Here's an example of cleaning up this data before you send it to the database.
Really, this is much easier than doing it with PL/SQL or Java.
Jared
our %hashData;
while(<DATA>) {
my($key, @data) = split(/\s/); if (defined($hashData{$key} ) ) { $hashData{$key} .= ' ' . join(' ',@data); } else { $hashData{$key} = join(' ',@data); }
}
foreach my $key ( sort keys %hashData ) {
print "Key: $key - |$hashData{$key}|\n"; }
__DATA__
100 Memo line 1 information.
100 more information for record 100.
100 extra information again.
200 Memo for 200.
200 more info for 200
300 info for 300
300 next memo
300 and more
300 yet more again.
On Thursday 17 May 2001 10:45, Glenn Travis wrote:
> I have a data file that looks like this;
>
>
>
>
-- 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 Thu May 17 2001 - 12:49:54 CDT
![]() |
![]() |