I would like to replace the specific strings ('Alpha', 'Bravo', 'Charlie')
in the above command line with a simple text file so that additional filters
can be added without having to change the command itself:
filters.csv
Filter
Alpha
Bravo
Charlie
...
Please advise?
matekus
--
Illiud Latine dici non potest
get-content .\today_all.txt | select-string -pattern '\(' -notmatch |
select-string (Get-Content filters.csv) -simplematch | set-content
.\today_filter.txt
- Larry
Your solution worked perfectly.
matekus
--
Illiud Latine dici non potest
"Larry__Weiss" wrote:
> Try
>
> get-content .\today_all.txt | select-string -pattern '\(' -notmatch |
> select-string (Get-Content filters.csv) -simplematch | set-content
> ..\today_filter.txt
>
> - Larry
>
> matekus wrote:
> > get-content .\today_all.txt | select-string -pattern '\(' -notmatch |
> > select-string 'Alpha', 'Bravo', 'Charlie' -simplematch | set-content
> > .\today_filter.txt
> >
> > I would like to replace the specific strings ('Alpha', 'Bravo', 'Charlie')
> > in the above command line with a simple text file so that additional filters
> > can be added without having to change the command itself:
> > filters.csv
> > Filter
> > Alpha
> > Bravo
> > Charlie
> > ...
> >
> > Please advise?
> >
> > matekus
> .
>