Hi,
I'm working on my script and trying to develop understanding of array association. Following for my own reference for the records which are not found in file2, print entries of file1 using Vgersh script:
nawk -F, 'FNR==NR{f1[$1];next} !($2 in f1)' OFS=, file1 file2
---------- Post updated at 10:08 PM ---------- Previous update was at 09:58 PM ----------
Hi,
I have got the results using above awk commands. Now I would like to perform comparison among the fields to look for specific set of characters. Based on the entry in field4 if it look for that entry in field 7 on the same line and see if it find the record then print "Record Match" otherwise "Difference in record". Please note that the entries in field7 contains longer string so the entry in field4 will be part of the complete string in field7. Furthermore, there is no specific start position of the string in field7.
Sample Input file:
12,1,456,RTF,111,12,PROG-RTF 12
1234,12,798, ESC,1,1234,ENTY ESC 345
456,1,886,ABC,434,567,YTRU-POYH 765
Sample Output File:
12,1,456,RTF,111,12,PROG-RTF 12 || Record Match
1234,12,798, ESC,1,1234,ENTY ESC 345 || Record Match
456,1,886,ABC,434,567,YTRU-POYH 765 || Difference in record
Thanks in advance for your help!