I have a config file like so:
<some dumb markup>
FOO,this,is,a,CSV,file,CHART1
BAR,this,is,a,CSV,file,CHART2
...
<more dumb markup
I have a shell script that wgets and filters this like so:
wget -O - $URL | grep -E '*[A-Z]{2}' > mycharts.data
This works dandy but now I want to exclude certain configs from mycharts.data. In other words, I want to print lines to mycharts.data ONLY if they DO NOT any tokens in a blacklist file. If I can do that, I can avoid adding blacklisting code to every other program that accesses mycharts.data. The blacklist file is simple; it's just a list of charts to be blacklisted.
Blacklist file:
CHART1
CHARTXyz
TRAHC1
...
I can't use a hard-coded regexp because the blacklist file can be different every time. I'm failing. I don't know whether to use sed or awk or whatever for the match. I tried something like this
wget -O - | grep -E '*[A-Z]{2}' | awk '!/BLACK|LISTED|CHARTS/' > mycharts.data
I need a way to loop through the regexpen stored in the blacklist file, but I'm not having any luck.