title: Displaying lines from text file in a batch file
body: <p>I'm tryin' to find a script that will let me display "linenumber# and linenumber# as well as lines#-#" from a text file in a batch file? I found this script here on this site..</p>
  
  <pre><code>@echo off
  setlocal enabledelayedexpansion
  if [%1] == [] goto usage
  if [%2] == [] goto usage
  
  SET /a counter=0
  
  for /f "usebackq delims=" %%a in (%2) do (
  if "!counter!"=="%1" goto exit
  echo %%a
  set /a counter+=1
  )
  
  goto exit
  
  :usage
  echo Usage: head.bat COUNT FILENAME
  
  :exit
  </code></pre>
  
  <p>And it works great :) But it grabs the number of lines from the top of the text file. I want to be able to display certain lines in the text file, as well as a range if possible..</p>
  
  <p>EG: I have a text file with 30 lines, and I want to display lines 1-4; 7-11; 13; 17-20; 22; 26 &amp; 29</p>