Alexander
Alexander

Reputation: 1

How to find strings from a list that didnt find exact matches from a file

The question How to grep exact matches from a file of a list of strings asks how to find strings from one file (A) in another file (B), but only where the string makes up a complete field in file B. The awk command provided works perfectly. But how can I see which strings from file A didn't find a match in file B?

Upvotes: 0

Views: 62

Answers (1)

kev
kev

Reputation: 161994

You can try this:

awk 'FNR==NR{b[$1];next} !($4 in b)' B A

Upvotes: 1

Related Questions