title: Parsing text file in windows command file with findstr
body: <p>I am writing bat-file to use several executable files (tools that I cannot change) sequentially.
  Firs of the tool receive two file names and produce txt file. </p>
  
  <p>Example 1:</p>
  
  <pre><code>Best score for a1_score.txt: 5712
  Best score for a2_score.txt: 14696
  </code></pre>
  
  <p>Example 2:</p>
  
  <pre><code>Best score for data\a1_score.txt: 3023
  Best score for data\a2_score.txt: 451
  </code></pre>
  
  <p>Example 3:</p>
  
  <pre><code>Best score for D:\tmp\a1_score.txt: 234
  Best score for D:\tmp\a2_score.txt: 1062
  </code></pre>
  
  <p>Strings are different because of including full file path. But, fortunately names of file ("a1_score.txt " and "a2_score.txt") will not be changed.</p>
  
  <p>I need two numbers to call next tool, so I tried to write script … but I'm not familiar with the command language and examples I have found in the Internet are not so useful.
  Please, help ne to complete the following code:</p>
  
  <pre><code>if exist scores.dat goto scores
  echo Cannot read scores
  goto BADEND
  
  :scores
  for /f "delims=" %%a in ('findstr /c:a1_score.txt /c:a2_score.txt "scores.dat"') do (
      set str=%%a
      :: some code to create a1_score and a2_score with corresponding values
  
  )
  echo %a1_score%
  echo %a2_score%
  
  :: some other code
  
  goto END
  :BADEND
  echo Process was not completed due to errors
  :END
  pause
  </code></pre>