in reply to hash jerkin

If order of lines in file_B is not important, and if there's no one-to-one line relationship order-wise between file_A and file_B, I'd change your algorithm to this: