Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Data with carriage return and SQL loader

Re: Data with carriage return and SQL loader

From: Jared Still <jkstill_at_bcbso.com>
Date: Wed, 11 Oct 2000 22:01:09 -0700 (PDT)
Message-Id: <10646.119032@fatcity.com>


Try this:



#!/usr/bin/perl

# cleandata

my $CR=chr(13);
my $LF=chr(10);
my $QUOTE="'";

open(X,"x.txt");

while(<X>) {

        s/([^$QUOTE])$CR$LF/$1/;
        print;
}                 

--------------------

cleandata < baddata.txt > gooddata.txt

On Wed, 11 Oct 2000, Dmitriy M. Labutin wrote:

> Dear All
>
> Could you please help me with loading comma delimited file into Oracle
> database on Windows NT.
>
> The problem is some data fields contain carriage return pair, for example
>
> 1,'abc
> def'
> 2,'data with carriage
> return'
> 3,'Data w/o carriage return'
>
> I can replace this pair with perl script, but I need carriage return present
> in the table - no replacement.
>
> Cheers,
> Dimitri
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Dmitriy M. Labutin
> INET: Dmitriy_Labutin_at_ep.minsk.by
>
> 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).
>

Jared Still
Certified Oracle DBA and Part Time Perl Evangelist ;-) Regence BlueCross BlueShield of Oregon
jkstill_at_bcbso.com - Work - preferred address Received on Thu Oct 12 2000 - 00:01:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US