Help with script to open and compare csv files

We are testing an application that accesses two tables: A and B. I am to write a script to validate the ouput files of this application.The application marks any account that has become overdue as per rule. When it runs, it updates the overdue flag in the A table according to the following rules:

  • Any account with a balance that was due before Oct 23, 2007 has an overdue value of 1
  • Any account without an overdue balance has a NULL overdue value or an overdue value of 0

Attached is the output of the two tables after the application has run.

I need to write a test script to verify that the data in the files is correct. The script needs to take in 2 command line arguments - the name of the 2 files. The output should indicate any problem accounts and nothing for accounts that have their overdue value properly set.

What have you tried so far? It looks like you are asking viewers to look into a problem that has only requirements, but not a suggested approach.
By the way, when trying to open the files on a machine that has only Gnumeric installed, the following message shows:
/tmp/Book1.xls could not be opened, because the associated helper application does not exist. Change the association in your preferences.