title: How do I increment a DOS variable in a FOR /F loop?
body: <p>I'm trying to read text lines from a file, and increment a counter so I can eventually simulate an array in DOS.</p>
  
  <p>I'd like to be able to store the lines of text in a DOS array for further processing.</p>
  
  <p>My current attempt is:</p>
  
  <pre><code>set TEXT_T="myfile.txt"
  
  set /a c=1
  
  FOR /F "tokens=1 usebackq" %%i in (%TEXT_T%) do (
  set /a c=c+1
  echo %%i,  %c%
  )
  </code></pre>
  
  <p>But the variable c is not incrementing; it stays at 1.</p>
  
  <p>Suggestions welcome.</p>
  
  <p>Thanks, Mike</p>