batch file - Need a way to obtain total instances after finding using FINDSTR -


so have far , works finding specified string need echo total number of times it's found.

findstr /c:"\"ma\"" %fn% 

thanks in advance.

findstr has no counter, find has (but has no regex).

also findstr /c: searches \"ma\" literally. should add /r (assuming search "ma"). can combine both commands needs:

findstr /r /c:"\"ma\"" %fn% | find /c /v ""  

Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -