title: Read every 5th line using Batch Script
body: <p>I want to make a batch program with will display every 5th line of a text file, like line no 1, 6, 11, 16 ....
  I tried modifying head.bat code found here: <a href="https://stackoverflow.com/q/130116/395703">Windows batch command(s) to read first line from text file</a></p>
  
  <p>My code is like below:</p>
  
  <pre><code>@echo off
  setlocal enabledelayedexpansion
  if [%1] == [] goto usage
  
  SET /a counter=0
  
  for /f "usebackq delims=" %%a in (%1) do (
  set /a testcond=(%%counter-1)%4
  if "!testcond!"=="0" echo %%a
  set /a counter+=1
  )
  
  goto exit
  
  :usage
  echo Usage: fifth FILENAME
  
  :exit
  </code></pre>
  
  <p>This code is not working. Can you please tell me what is the wrong with this code?</p>