Link to home
Start Free TrialLog in
Avatar of Jyothi_pg
Jyothi_pg

asked on

Formatting output file after running it from isql

Hi,

  I would like to format the output file from isql. My command is something like this..

 isql -s "|" -i "inputfile" -o "outputfile" -b -w 400

 I have suppressed the (3 rows affected) message by including SET NOCOUNT ON in the stored procedure. But i'm getting 2 lines of "return status=0" in the output file which i would like to eliminate. I would  like the output file to have pure data with the delimiters. I would be thankful if I get some help to resolve this matter.

Thanks.
Avatar of herrmann1001
herrmann1001

The following link tells you about the changes between 10.x and 11.x  of ISQL...  Maybe you can do something about the tips in the end of the page.

http://www.sybase.com/detail?id=1013403


Best of times!
Assuming you are on UNIX:

isql -s "|" -i <inputfile>  -b -w 400 | grep -v "return status=" | tee <outputfile>
try this

isql -U$USERNAME -P$PASSWORD -S$SERVER -s"|" -o$RESULTFILE <<!
select * from table1,table2 where table1_Field1=table2_Field2
go
!
cat $RESULTFILE|sed -n "3,$ p"|grep ^\| > $RESULTFILE.temp
mv -f $RESULTFILE.temp $RESULTFILE
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial