Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Spooling to Text File - Removing Blank Line

spalato76Dec 18 2010 — edited Dec 18 2010
Hi All,

I'm trying to spool the results of a query into a text file using the following code:

Spool on
set heading off
SET LINESIZE 4000
Spool "C:\spooltext.txt"
select
record_value
from test
where rownum <=1000
Spool off

The header column is not displayed because I set the heading off option above but it's still leaving a blank line after every x number of records so it looks like this in the text file when I open it:

A1111100010010
B2000010120001231
C00EMGPQRST
E193610162 27228816002
E193304112 27228889100
M F10720000503272288891001NA50BABD
M F10720000602272288891001NA50BABD
M F10720000602272288891002NK70BA

MH524 D2062000042027228889100
MK222 D1072000050327228889100
MK222 D1072000050327228889100
MM548 D2062000111027228889100
MQ390 E1072000050327228889100
MQ390 E1072000050327228889100
MR074 D2062000092827228889100
MR130 D1072000050327228889100

MR130 D1072000050327228889100
MR130 D1072000060227228889100
MR104 D4092000030227228889100
MZ000 D2062000042727228889100
MZ014 E2062000042727228889100
E193302262 27228998100
MF419 E2062000072727228998100
MF419 D4092000072727228998100

MI101 D1072000051727228998100
MI101 D2062000051727228998100
MI100 D2062000072727228998100
MI100 E4092000072727228998100
MI100 D2062000102527228998100
MR074 D1072000051727228998100
MR074 D1072000051727228998100
MR074 E1072000051727228998100

MR074 E4092000051727228998100
MR073 E1072000051727228998100
MR030 D1072000051727228998100
MR030 D4092000051727228998100
MZ903 E1072000051727228998100

For the example above, the space was added after every 8 records for example reasons only but in my actual file it was adding a blank line after every 23 records.

How do I remove the blank lines??

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 15 2011
Added on Dec 18 2010
2 comments
10,479 views