Comparing rows in two tables and sending the differnce to mail

Hi,

I have a table ,containg 2 coloumns and many rows,which is updated everyday.The no.of rows in the table changes everyday.
i have to write the difference between yesterdays tabtle and todays table
to a new file.The row that is new in the todays table need not to be shown.only the change in the values from yesterdya to today should be shown.

ex:
yesterday table 1 2
3 4
6 8

todays table 1 2
5 4
6 9
2 5

I have to write the script in a such a way that ,
The output file should show

in coloumn1 3 is changed to 5
and in coloumn2 8 is changed to 9

and the outputfile has to be sent the mail id.

Please help me,
Thanks.

Try this:

awk '
        NR==FNR { yesterday[NR,1]=$1; yesterday[NR,2]=$2; max=NR; next }
        FNR <= max && $1 != yesterday[FNR,1] {
                print "in column1",yesterday[FNR,1],"is changed to",$1
        }
        FNR <= max && $2 != yesterday[FNR,2] {
                print "in column2",yesterday[FNR,2],"is changed to",$2
        }
' yesterday today

this seems to be something that could be done easily with

CPAN's List::Compare module

where yesterday's data and today's data would be two set of lists and methods provided to retrieve required data can be used