Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to get a variable length ASCII file from SQL*PLUS output
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
![]() |
![]() |