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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to get a variable length ASCII file from SQL*PLUS output

Re: How to get a variable length ASCII file from SQL*PLUS output

From: Jurij Modic <jurij.modic_at_mf.sigov.mail.si>
Date: 1997/10/03
Message-ID: <3434f756.958799@www.sigov.si>#1/1

On 2 Oct 1997 02:55:36 GMT, "Bu Yun Fei" <yfbu_at_ctlsg.creaf.com> wrote:

>Hi,
>
>I'm currently doing data conversion from Oracle database and I need to
>output data to a variable length ASCII file, which means at the end of each
>record inside the file, there shouldn't be any trailing space behind. It
>seems to me that the output from SQL*PLUS is always fixed length.

In the newer releases of SQL*Plus (at least in version 3.3, I'm not sure about prior releases) there is a SET parameter called TRIMSPOOL which controls exactly the behavior you are asking for. The default for this parameter is OFF, which means each line of spooled output is right-paded up to the length of LINESIZE. Set this parameter to ON and sqlplus will trimm the spooled lines, i.e.

SQL> SET TRIMSPOOL ON So there is no need to post-process the output file in UNIX.

>Appreciate if anyone could tell me how to convert a fixed length text file
>to a variable length file by using certain UNIX command.
>
>Thanks in advance !
>
>Yun Fei
>e-mail : yfbu_at_ctlsg.creaf.com

Regards,


Jurij Modic                             Republic of Slovenia
jurij.modic_at_mf.sigov.mail.si		Ministry of Finance
============================================================
The above opinions are mine and do not represent any official standpoints of my employer Received on Fri Oct 03 1997 - 00:00:00 CDT

Original text of this message

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