Re: convert newlines UNIX - DOS / DOS to UNIX
From: onedbguru <onedbguru_at_yahoo.com>
Date: Sat, 15 Jan 2011 15:43:38 -0800 (PST)
Message-ID: <573ca798-f904-4793-ab09-3fec5396a900_at_q18g2000vbk.googlegroups.com>
On Jan 15, 1:51 pm, Mladen Gogala <gogala.mla..._at_gmail.com> wrote:
> On Thu, 13 Jan 2011 12:52:30 -0800, oldyork90 wrote:
> > I want to build an oracle function, in a 10g Unicode database, that
> > accepts a varchar, of any length, and returns a translation. It will
> > translate all found DOS NL to UNIX NL, or UNIX NL to DOS NL. It has to
> > be bullet proof. I'm off to give this a try with the regular express
> > package, but I'd like to get any input from the Oracle Jones. Thank you.
>
> Let me try and take a shot: you would need to replace \n\r (DOS standard)
> with \n (Unix standard). You mentioned Oracle 10g, which supports regular
> expressions. That shouldn't be very hard to do.
>
> --http://mgogala.byethost5.com
Date: Sat, 15 Jan 2011 15:43:38 -0800 (PST)
Message-ID: <573ca798-f904-4793-ab09-3fec5396a900_at_q18g2000vbk.googlegroups.com>
On Jan 15, 1:51 pm, Mladen Gogala <gogala.mla..._at_gmail.com> wrote:
> On Thu, 13 Jan 2011 12:52:30 -0800, oldyork90 wrote:
> > I want to build an oracle function, in a 10g Unicode database, that
> > accepts a varchar, of any length, and returns a translation. It will
> > translate all found DOS NL to UNIX NL, or UNIX NL to DOS NL. It has to
> > be bullet proof. I'm off to give this a try with the regular express
> > package, but I'd like to get any input from the Oracle Jones. Thank you.
>
> Let me try and take a shot: you would need to replace \n\r (DOS standard)
> with \n (Unix standard). You mentioned Oracle 10g, which supports regular
> expressions. That shouldn't be very hard to do.
>
> --http://mgogala.byethost5.com
If he were a programmer type, he could also find the C sources for DOS2UNIX.c and UNIX2DOS.c and create an external procedure that does the work for him without trying to re-invent the wheel...
Just a thought... Received on Sat Jan 15 2011 - 17:43:38 CST