HOW-TO Extract Lines from File A that Contains Words in File B?
#9
(01-05-2015, 02:53 AM)magnum Wrote: The program you need was written like 60 years ago and it's free.

grep -Ff B.txt A.txt > C.txt

EDIT: This is better:

grep -wFf B.txt A.txt > C.txt

(And to make it case insensitive, use -iwFf)

You my friend are amazing! Thank you so much for that great info, grep works like it's literally some sort of magic or something, it boggles my mind how it finds all the matches and how it does it so fast. True genius.


Messages In This Thread
RE: HOW-TO Extract Lines from File A that Contains Words in File B? - by TNin615 - 01-05-2015, 08:26 AM