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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Silly little sqlplus question :)

Re: Silly little sqlplus question :)

From: Mladen Gogala <gogala_at_sbcglobal.net>
Date: Sat, 09 Jul 2005 16:02:09 GMT
Message-Id: <pan.2005.07.09.16.02.05.348459@sbcglobal.net>


On Fri, 08 Jul 2005 05:24:02 -0700, grz02 wrote:

> I have a little silly problem in spooling data from sqlplus to a file in
> the exact format I want. To demonstrate it, here is a simple test-case.
> In sqlplus under unix I run those commands:
>
> set linesize 9999
> set pagesize 49999
> set trimspool on
> set feed off
> set head off
> set echo off
> set verify off
> set termout off
> spool myfile.txt
> select 'ABC' from dual;
> select 'XYZ' from dual;
> spool off
>
> I put those commands in a script, and then run
> sqlplus user/password @myscript.sql
>
> Now, my problem is that the output file will have a blank line
> before each row of output, i.e:
>
> <blankline>
> ABC
> <blankline>
> XYZ
>
> rather than just
>
> ABC
> XYZ
>
> that I would like.
> Any way I can avoid those blank lines
> (without post-processing the output, of course)?
>
> ----------------------------------------- grz01

perl -pe 's/\s+$/\n/' < myfile.txt>yourfile.txt

That is why it's called "Pathologically Eclectic Rubbish Lister"

-- 
http://www.mgogala.com
Received on Sat Jul 09 2005 - 11:02:09 CDT

Original text of this message

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