in reply to How to read the regular expression from another file?
i want a perl script that reads file2 and print the lines which has any of the words listed in file1 (i.e. either a_c or b_c or c_c) and save those lines in new file.
Just on the off-chance that this isn't just a programming exercise it is worth pointing out that grep can do this already:
grep -f file1 file2 > newfile
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to read the regular expression from another file?
by KurtSchwind (Chaplain) on May 07, 2015 at 19:25 UTC |