Artificial intelligent assistant

First Match - awk consider file having values: foo boo too and another one: foo,1 foo,2 boo,1 soo,1 How to get only first match from the 2nd file, where output will be: foo,1 boo,1

How about


$ awk -F, 'NR==FNR {a[$1]; next} $1 in a {print; delete a[$1]}' file1 file2
foo,1
boo,1

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy f323151b8bf79d8c910e5d389786bb37