file1:
abc|123|check
def|456|map
ijk|789|globe
lmn|101112|equator
Run Code Online (Sandbox Code Playgroud)
file2:
abc|123|check
def|456|map
ijk|789|equator
lmn|101112|globe
Run Code Online (Sandbox Code Playgroud)
EXPECTED OUTPUT:
ijk|789|equator
lmn|101112|globe
Run Code Online (Sandbox Code Playgroud)
Current awk script:
awk 'BEGIN{OFS=FS="|"} NR==FNR{a[$3]=$3;next}!($3 in a)' file1 file2
This does comparison based on array content. How to compare line by line and printing only that results.