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: Dmitriy M. Labutin <Dmitriy_Labutin_at_ep.minsk.by>
Date: Thu, 12 Oct 2000 12:07:19 +0300
Message-Id: <10647.119044@fatcity.com>


Jared,

Yes, no problem to replace - the problem I want carriage return in the table field AFTER loading!

Thanks anyway!

Cheers,
Dimitri

-----Original Message-----
From: Jared Still [mailto:jkstill_at_bcbso.com] Sent: Thursday, October 12, 2000 9:06 AM To: Multiple recipients of list ORACLE-L Subject: Re: Data with carriage return and SQL loader

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 jkstill_at_teleport.com - private

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Jared Still
  INET: jkstill_at_bcbso.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
Received on Thu Oct 12 2000 - 04:07:19 CDT

Original text of this message

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