I’m having a text file and I want to run a batch file which reads the entire text file and tells me the no: of occurrences of a string “PASS”:
Could you pl help how to do that – I’m not able to understand the usage of tokens in BAT file.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Maybe the
findstrcommand will help you: Findstr Help.It doesn’t print the number of occurences, but maybe you can do something with the results.
UPDATE:
The Find command has a
/coption, which counts the number of lines containing that string.