Shell scripting and SQL

Hi,

I have a file that has contents like this:
SQL> select * from details;

NAME REG
-------------------- ----------
Mani 1
Santosh 2
Manju 3
Mukesh 4

SQL> spool off;

I want to remove the first line'select * from details' and the last line 'spool off'. I also want to remove the lines 'Name Reg and the line below them' and also introduce a new field seperator between values. How can I do it.

to remove Name Reg use the following

for the rest the following may work, I am not sure though

or

or
somthing similar to above
Do post ack what work and what not
Gaurav

Hi,

That worked. But What I want is to print the same in a file without the SQL>. But when I do the same thing by spooling to a file, I still get the command I issued i.e 'select * from details and 'spool off'.

I want to remove those also.

Thanks in advance

tell me which one worked.
have you tried the feedback off option

Hi,

Yes. I trie all the 3 options together. What was happening was , the title of the columns was not displayed namely 'Name Reg'. The line also was not displayed.

But the comand 'select * from details' was displayed and the command 'spool off' was displayed'

Thanks in advance

Hi,

Before "spool" command ,issue the following:
set termout off
set pause off
set pagesize 0
set feedback off
set time off
set heading off
set echo off

Regards,
Nir