Searching for information taken from one file in another file is quite a common task. The usual solution is to hash the identifiers, then iterate over the second file and check the hash for the existence of the identifier.