Remover Banner and SQL prompt from isql

Hi,
I am using isql and putting the output in a file in a shell script in Linux.
However in my output i am getting the banner and a SQL prompt(at the start and the end of query output)
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>query output
SQL>

I need just the query result

Any ideas on how to acheive this?

Like this?

awk '!/^+|\|/{sub(/^SQL>/, "");print}' file

yes its working!!!thanks a ton
Could you please explain me the command as i am not familiar with awk
Thanks

Certainly. Awk syntax is based on a </condition/>{action} pattern that will process every line of the file.

Here, the condition is:
!/^\+|\|/ all lines that does not (the ! in front of the /condition/) start either with + or | (escaped as these are two regex operators)

The action:
{sub(/^SQL>/, "");print}' first replace the SQL> string by nothing if it is at the start of the line. Then, print the modified record.

ok.But how did the Banner get removed?

Because I asked to print only the lines the are *not* starting with + or |. And the remaining lines that are printed are modified to get rid of the SQL prompt.

Ok.Thank u so much!!