I have two files "f1" and "f2" having 2 fields in each, a) file size and b) file name. The data are almost same in both the files except for few and new additional lines. Now, I have to find out and print the output as, the difference in the "file size" for the file names present in the f1 and f2 and also, fields that are not present in both the files.
Note: the number of lines in the files may differ. And the file sizes are in KB.
Thank you bartus, it worked perfectly. But, I cannot decode the logic. Could you please explain this to me?
Few doubts in this:
NR!=FNR --> this is needed because I told that counting of the lines may not be same in both the files? Or this is an indicator to parse the second file? If that so, this explicit indication is really needed to make awk to parse the 2nd file? Please clarify me.
Suppose if I want to print the common lines (similar lines not the unique) in both the files also, then I have to just remove the condition if (a[i]!=0)?