SET TRIMS ON
SET PAGESIZE 0
SET EMBEDDED OFF
SET HEADS OFF
SET NEWP NONE
SET HEADING OFF
SET ECHO OFF
SET FEEDBACK OFF
SET LIN 8
SET SPACE 0
SET RECSEP OFF
SPOOL $DATA_DIR/sysctl.asc
SELECT TO_CHAR(LAST_DAY(ADD_MONTHS(SYSDATE,-1)),'YYYYMMDD') FROM DUAL
/
SPOOL OFF
EXIT
How do I get rid of the 1k new line Character?????
What I don't understand is the "SET PAGESIZE 0" should "supress all
headings, pagebreaks,titles,the initial blank line,and other formatting
information ." according to the SQL+ manaual. The O/S is Sun 2.6 and
the Oracle is 8.01 if it matters.....
TIA
Sent via Deja.com http://www.deja.com/
Before you buy.
You'll not rid yourself of the newline character through any 'magic'
from SQL*Plus. What I don't understand is that your UNIX script does
not want the inherent newline character. I have written a number of
UNIX scripts to process batch runs and this has never been a problem.
If you truly having difficulty processing the output from your query
through your UNIX script I will be more than happy to help you sort
that out. Either post the script or email me a copy at
dav...@bcgsystems.com and I'll help you fix it to accept your current
spool file.
--
David Fitzjarrell
Oracle Certified DBA
Thanks for the help,
Kevin
In article <915cm9$daf$1...@nnrp1.deja.com>,
I would just do this with sed in a Unix script. I believe \n is the
newline. This can be very tricky. I know I did it with an example from
man page for sed on Digital Unix. There may be easier ways, but this will
work.
The PC is generating \r\n at the end of each line. There is no way to
remove this from the SQLPlus output. You can add additional line or
other symbols.
vi on the PC probably will not see this.
This problem is one of the most common problems in moving files from
the PC to unix and/or back.
The most obvious idea is to cleanup the file under unix. Sed is the
simplist choice.
Off the top of my head,
sed 's/\r//' <file> |
could be used instead of the file name. You could also use sed to
preprocess the file prior to calling it in the unix script.
If you are using perl, you can do the substitution when you are reading
in the line in the file.
--
Michael Krolewski
Rosetta Inpharmatics
mkrol...@rii.com
Usual disclaimers