Created
February 27, 2017 22:15
-
-
Save plantarum/80937e21cde1f51764ee3727f92a50a6 to your computer and use it in GitHub Desktop.
loop over regexes to exclude them from a file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## make a copy of the original file that we can modify | |
cp original_data outfile | |
## loop over a file of regexs, applying each to our output | |
while read rx; do | |
grep -v $rx outfile > outfile.tmp | |
mv outfile.tmp outfile | |
done < regex_file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment