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
In reply to Re: How to read the regular expression from another file?
by hippo
in thread How to read the regular expression from another file?
by sumathigokul
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |