dbTalk Databases Forums  

convert newlines UNIX - DOS / DOS to UNIX

comp.databases.oracle.server comp.databases.oracle.server


Discuss convert newlines UNIX - DOS / DOS to UNIX in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
oldyork90
 
Posts: n/a

Default convert newlines UNIX - DOS / DOS to UNIX - 01-13-2011 , 02:52 PM






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.

(David Fitzjarrell??? where are you? Punish me please! :-)

Reply With Quote
  #2  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: convert newlines UNIX - DOS / DOS to UNIX - 01-15-2011 , 12:51 PM






On Thu, 13 Jan 2011 12:52:30 -0800, oldyork90 wrote:

Quote:
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

Reply With Quote
  #3  
Old   
onedbguru
 
Posts: n/a

Default Re: convert newlines UNIX - DOS / DOS to UNIX - 01-15-2011 , 05:43 PM



On Jan 15, 1:51*pm, Mladen Gogala <gogala.mla... (AT) gmail (DOT) com> wrote:
Quote:
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...

Reply With Quote
  #4  
Old   
John Hurley
 
Posts: n/a

Default Re: convert newlines UNIX - DOS / DOS to UNIX - 01-15-2011 , 07:45 PM



Mladen:

#t 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.

Why do it inside a database call what the operating systems provide
already?

Reply With Quote
  #5  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: convert newlines UNIX - DOS / DOS to UNIX - 01-16-2011 , 11:23 AM



On Sat, 15 Jan 2011 17:45:53 -0800, John Hurley wrote:

Quote:
Why do it inside a database call what the operating systems provide
already?
Because that's what he asked about. I agree with you, I normally don't do
it within the database.



--
http://mgogala.byethost5.com

Reply With Quote
  #6  
Old   
onedbguru
 
Posts: n/a

Default Re: convert newlines UNIX - DOS / DOS to UNIX - 01-17-2011 , 04:11 PM



On Jan 16, 12:23*pm, Mladen Gogala <gogala.mla... (AT) gmail (DOT) com> wrote:
Quote:
On Sat, 15 Jan 2011 17:45:53 -0800, John Hurley wrote:
Why do it inside a database call what the operating systems provide
already?

Because that's what he asked about. I agree with you, I normally don't do
it within the database.

--http://mgogala.byethost5.com
Exactly. I also agree with you Mladen. What he should really be
doing is to trim this sort of thing before ever storing it in the
database. However, for every "should be" there are many other "but in
THIS case..."

Sometimes ya just can't win.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.