Please help me in achieving the following criteria
There are two files with same record layout. The first two fields will act as a key(these two fields are common in both files), and the requirement is to compare the remaining fields of those two similar records. If any field is different then the output file should be written with the key fields followed by the mismatch field Number. The output file should contain records which have mismatch fields.
It looks like this
File 1:
1 2 3 4 5
Record 1: ABC XYZ SSS AAA BBB
Record 2: PQR CBA EEE OOO CCC
Record 3: EPF ETR UUU JJJ GGG
1 2 3 4 5
Record 1: ABC XYZ SSS AAA BBB
Record 2: PQR CBA EEE OOO CCC
Record 3: EPF ETR UUU JJJ GGG
File 2:
1 2 3 4 5
Record 1: ABC XYZ SSS PPP BBB
Record 2: PQR CBA EEE OOO CCC
Record 3: EPF ETR MMM JJJ QQQ
1 2 3 4 5
Record 1: ABC XYZ SSS PPP BBB
Record 2: PQR CBA EEE OOO CCC
Record 3: EPF ETR MMM JJJ QQQ
Output File:
Record 1: ABC XYZ 4
Record 2: EPF ETR 3 5
Record 1: ABC XYZ 4
Record 2: EPF ETR 3 5
Any change in achieving the requirement is always welcome.
My main requirement is to get the field names which are not matching.