Fastest way to find lines of a file from another larger file in Bash
A Perl solution. [See Note below.] Use a hash for the first file. As you read the big file line-by-line, extract the field by regex (captures the first pattern between ||) or split (gets the second word) and print if it exists. They likely differ in speed a bit (time them). The defined check … Read more