title: windows batch file / get last word in a line
body: <p>I have a weird case in batch file.</p>
  
  <p>I have a txt file named state.txt containing the following line :</p>
  
  <pre><code>State          ON
  </code></pre>
  
  <p>I need to read the "ON" word (it can be OFF as well), so I'm using the following simple batch file :</p>
  
  <pre><code>@echo off
  for /f "tokens=2" %%a in (state.txt) do set word1=%%a
  echo %word1%
  </code></pre>
  
  <p>when executing the batch file , I dont get any output , but when I change the "ON" or "OFF" word to any other word it's shown.</p>
  
  <p>I'm confused here! what's the relation between ON/OFF and the output got.</p>