findstr /s /i <string1> <string2> *.txt- findstr | MS Learn
- Select-String (sls):
sls <pattern> <path> - Measure-Object (measure)
- ForEach-Object (%)
Sort-Object -Unique(sort) ∙∙∙∙∙∙∙ Get-Unique (gu)- Out-String -Stream
$str -Match "<regex>"
$str | sls "<regex>"
sls -Path <./file.txt> -Pattern "<regex>" -CaseSensitive | Measure-Object
# : Count occurences of <regex> (up to one per line)
sls "<regex>" <path/file> -AllMatches | % {$_.Matches.Value} | measure
# : Count ALL <regex> in file using -AllMatches and foreach (%)
sls "\(\d{3}\)" ... | % {$_.Matches.Value} | sort -Unique | measure
# : Count unique area codes in a list of phone numbers- Understand the raw output of each command in the pipeline. Does sls output only the matched text?