in reply to extract line
Yep, that't the right (and standard) way: open file2, load its content into a hash (each part nuùmber as a key to the hash), close file2; then scan file1 line by line, check if the part number is in the hash, print the line it it is. This is also very fast, since loopup in a hash is fast. It breaks only if file2 is so huge that it will not fit into memory.
|
|---|