Compare file1 for matching line in file2 and print the difference in matching lines
I have two files file 1 and file 2 each having result of a query on certain database tables and need to compare for Col1 in file1 with Col3 in file2, compare Col2 with Col4 and output the value of Col1 from File1 which is a) not present in Col3 of File2 b) value of Col2 is different from Col4:-
Field1 is not there in File2. Filed2 has a different count against it.
I tried using comm for this but it won't work as after sorting File2 still won't match the Fields line by line or won't consider the counts. Another restriction is I have to compare them in shell only.
Any help will be appreciated.
Last edited by joeyg; 11-07-2013 at 08:29 AM..
Reason: Please wrap data and commands/scripts inside CodeTags
Why must be done in shell?
If this is homework, there is a specific location to post homework requests.
The Package which runs the checks is designed in a way that it accepts only shell scripts or sql files. We are generating these two files via a shell script so need the rest of work to be done in shell itself.