I was wondering if anybody could tell me how to achieve the following, preferably with a little commenting for understanding.
I have 2 files, each with multiple rows with multiple columns.
I need to find each row where the value in column 1 of file 1 matches column 1 in file 2. I then need to compare the 4th column from the rows and if the value in file 2 is greater than in file 1 then output to a third file the matching column 1 value, the 2nd column value,the 4th column value in file 1 and file 2 and the difference between them.
An example should make the above clearer.
File 1
123 john blah 2
456 tony blah 7
789 michelle blah 9
111 james blah 3
File 2
135 gary blah 6
456 tony blah 13
789 michelle blah 4
111 james blah 19
This example works, I have a little more complicated comparison opperation. I have an index of IDs. These IDs are part of several substrings of a file. I want to see which IDs are in the file and which ones are not. Here are a few lines.