title: Counting occurrences of multiple strings in multiple files
body: <p>I've got multiple text files in a folder. For each one, I want to search for 3 different strings and add the counts of those strings together, then output them to a file.  </p>
  
  <p>This works for counting a single string in the different files:</p>
  
  <pre><code>for /f "delims==" %%a in ('dir /b "%CD%\*.txt"') do findstr /r /n "^.*SEARCH_STRING_1.*$" "%%~dpnxa" | find /c "SEARCH_STRING_1" &gt;&gt; "%%~dpacounts.txt"
  </code></pre>
  
  <p>This results in a file with a count on a new line for each file in the folder.  How can I search for "SEARCH_STRING_1", "SEARCH_STRING_2" and "SEARCH_STRING_3", add the counts together, and output them to the file the same way?</p>