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

symfony - InvalidConfigurationException in SecurityExtension.php line 429: No authentication listener registered for firewall "secured_area" -

angular ui router - 10 digest iterations reached in angularjs when using $state.go -

javascript - Handling constructor related functions while testing with mocha and sinon -