Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Spooling double spaced lines - arrrgggghhh!

Status
Not open for further replies.

evild

Technical User
Nov 25, 2002
71
GB
I frequently create reports by spooling to a txt file creating long lists up to thousands of lines long.
When I spool to a file all the lines are double spaced. For example:

001.4222 HAG 3604373822

001.4222 MAI 3604350213

but I want
001.4222 HAG 3604373822
001.4222 MAI 3604350213

Is there a setting to make this work?

I have several sql reports that do no double space and some that do. I have looked at example od both queries and am unable to find anything that would explain the difference.

Is this an issue to do with line size and the definition of my columns?

I have:
set echo off
set pause off
set heading on
set pagesize 50000
set linesize 400
set feedback off
set show off
set termout off

set on 2 separate queries. One returns double spaced lines and the other does not. [note that large pagesize and linesize - these values for testing purposes]

My column settings for my problem reports are:

column clnum format a17 heading "Class No."
column bar format a11 heading "Barcode"
column title format a40 heading "Title"
column stat format a6 heading "Status"
break on REPORT skip 4
compute count label 'Num of Items:' of bar on REPORT

As you can see the column size total will no exceed my linesize setting of 400.

Can anyone give me a hand on this? It seems like a trivial problem but I just cant see it.

Thanks
 
Try using following set statement as well :
set trims on

Regards
Ajay.
 
I have tried that. It helps with the file size but doesnt remove th extra blank line :(
 
Can you look at the result file by HEX editor? Sometimes it happens with some editors, that treat chr(13)chr(10) as 2 lines.

Regards, Dima
 
it seems your editor is doing word wrap because of linesize. Try diabling this option.

Martin Cabrera
Oracle DBA/Programmer
 
Unfortunately no, I have no hex editor and the people that would be viewing this file would not accept the report in this manner.
 
I have looked at the wrapping setting and cannot see anything wrong...

I do not beleive that this is the problem because even if i do not spool, there is still doubled spaces on the output.

Wordpad is used to view the file and it is fine with everything. Some double spaced some note.
 
I presume you are doing all this in SQL*Plus. With that presumption, and to isolate the problem, try these steps:

1) Issue the SQL*Plus command: set recsepchar "^"
2) Re-run your report
3) Check for the existence of "^" characters; if they appear in your output, you know the problem results from one or more of your output columns being too long for the defined column width.
4) If the you discover "^"s, then next try your output following the SQL*Plus setting: set recsep off.

Please advise the effect(s) of this troubleshooting.
 
I did as you suggested and it returned a whole line of ^s

I am looking into the column widths now and what is returned in the query...

Ill will update as I know more

Thanks
 
Ah ha!!

I fixed it at last.
There was an error on the column widths.

One of the column I return is a barcode which is always always 10 characters long. So naturally I set the column to fit this data.
I have since found that the barcode is in fact 15 characters long not 10. The extra 5 characters being spaces!

I have adjusted the column definistion and now all is fine. Something so simple leading to all of this. Programming, its the bane of my existance! ;)

Thanks for all the help. Good to learn a couple of extra troublshooting tests [set recsepchar "^" and set trims on].

 
One slight correction, EvilD: Programming is not the bane of life; it's the spice of life ! <smile>. Had you not run into this problem, look at all the fun stuff you wouldn't have learned about.

May you assiduously and ardently pursue your programming experiences such that they cause you to feel ebullient, effulgent, and coruscative !

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top