in reply to Simple filter from rows of input file
Hi ablakely,
From your code written, I can figure what you are doing is read from a file, then match what you read from the first file in the second file. Then write it out to the third file.
If that is correct, then do this, read the first file into a hash variable, then read the second file one line at a time, to match what you have in the hash, then simply print out to the third file. QED!
You can simply, write a subroutine that open and read a file and you use that to read the first two files!
Also don't forget to use strict; in your script! And check if your opened file failed!
|
|---|