Compare script

I have 8 set of files.

eg:
File 1 -- sybase row count
emp 45
dept 55
outln 78
xxx 91

File 2 -- oracle row count
emp 71
dept 10
outln 78
xxx 91
rtyurtuyrtuyrt 123
ghdfghdfghgh 6578

We have to compare such files get the difference and send output via mailx. See the program below it shows output like
next_number -1
v_man 5

I want to also display the text which is present in file 1 and not in file 2.
Alos display should have heading as -
Table _name oracle_count sybase_count Diff
Could you alter my prog or give a better prog.

#!/bin/ksh
DBALIST='abc@xyz.com'
SUBJECT="WARNING: xxx"
flag='N'
while read a1 a2
do
echo $a1
flag='N'
while read b1 b2
do
if [ $a1 = $b1 ]
then
flag='Y'
if [ $a2 = $b2 ]
then
echo matching
elif [ $a2 != $b2 ]
then
dif=`expr $a2 - $b2`
echo $a1 $dif >> diff.out
fi

 fi

done < oracle.sql
if [ $flag = 'N' ]
then
echo $a1 $a2 >> diff_master.out
fi
done < sybase.sql
mailx -s "$SUBJECT" $DBALIST < test.out

-------
Add the following header as first line in each email report:
Table_Name Sybase_RowCount Oracle_RowCnt Diff
Script needs comments and indenting to make it more readable. Indenting needed to visually see the if/elif/fi blocks and do blocks. Script does not capture any information if table exists in Sybase and not in Oracle or viceversa
If script finds no differences for any schema, still should get email indicating no differences for that schema.

I dont understand this part of your post.

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.