I read Comparing two files using Unix and Awk. It is really interesting. I read and tested it, but I can't understand it completely and use it in other cases.I have two files. file1 has one field and the other one has 16 fields. I want to read elements of file1 and compare them with 3rd field of file2. If there was a match for each element, I sum value of field 5 in file2. As an example:file 1123file 22 2 2 1 23 6 1 2 4 4 1 1 2 36 3 3 3 4 For element 1 in file1 I want to add values in field 5 of file2 where value of field 3 is 1. And do the same for element 2 and 3 in file1. The output for 1 is (3+4=7) and for 2 is 2 and for 3 is 4.I don't know how I should write it with awk.
Processing two files using awk
text processing;awk