Re: Spool & Trailing Blanks
Date: Wed, 27 Jan 1993 01:06:32 GMT
Message-ID: <1993Jan26.170632.1_at_us.oracle.com>
In article <1993Jan25.133239.1_at_ntc02.tele.nokia.fi>, kuismin_at_ntc02.tele.nokia.fi writes:
>
> My environment:
> * SunOS Release 4.1.3
> * Oracle SQL*Plus v.3.0.12.2.1
> * Oracle RDBMS v.6.0.36.4.1
> * Oracle PL/SQL v.1.0.35.1.1
>
> What is done?
> I'm spooling my query into a file with SQL*Plus's SPOOL command.
>
> What is the problem?
> 1) Trailing blanks
>
> SQL*Plus uses LINESIZE setting and puts trailing blanks in the
> end of each line it spools. I need to remove all these blanks!
>
> Can this be done by SQL*Plus?
> What unix commands could be used to do this? I'm novice with unix.
>
In UNIX, you can type :
sed -e 's/ *$//g' myfile.lst > myfile.lis
this says, "delete one or more blanks at the end of each line". Works
great.
>
> 2) Unix to Dos convertion
>
> My final aim is to convert the spooled file, which in UNIX
> format, into DOS format. That is, I need to put <CR><LF>
> instead of <LF> in the end of each line.
>
> Can this be done by SQL*Plus?
> What unix command could be used to do this? I'm novice with unix.
>
>
Depends on how you convert it to DOS. Most modem software alows you to
specify what to do with CR/LF when the file type is TEXT.
>
> This is what I get now:
>
> line1 line1 <LF>
> line2 line2 line2 line2 <LF>
> line3 line3 line3 <LF>
>
> This is what I want to have:
>
> line1 line1<CR><LF>
> line2 line2 line2 line2<CR><LF>
> line3 line3 line3<CR><LF>
>
> Any help is appreciated!
>
> -Mikko Kuismin
>
-- ================================================================================ Scott Stephens inet: sstephen.us.oracle.com Oracle WorldWide Support Redwood City, CaliforniaReceived on Wed Jan 27 1993 - 02:06:32 CET