Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Silly little sqlplus question :)
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.comReceived on Sat Jul 09 2005 - 11:02:09 CDT