Working in the default Unix environment that comes with Mac computers. Environment contains the following:
- 1 file that is a list of ~250 words I want to use as search patterns
- 10 or so .tsv files to search individually using each of these search patterns
- 1 file to append with the search results
I want to run the following script:
for file in *.tsv;
do
echo "Processing $file";
grep -n PATTERN $file | cut -f 1,2,3 >> Results_File.lst;
done
But I do not know how to run the script repeatedly for multiple patterns stored in a separate file.
Here is a small slice of the patterns file:
AXDND1
BAZ2B
BBS10
BRIP1
etc