title: Keep just last 100 rows of data in text file
body: <p>I have this script within a <code>.bat</code> file and would like to only keep the most recent 100 lines, at the end of the file.</p>
  
  <p>How do I delete all other rows?</p>
  
  <pre><code>@echo off  
  REM *DATETIME2.BAT 
  REM *Copy date and time to create a new log file 
  echo.|date&gt;&gt;"\\spserver\myfolder\dt.tmp" 
  echo.|time&gt;&gt;"\\spserver\myfolder\dt.tmp"   
  IF NOT EXIST "\\spserver\myfolder\dt.tmp" GOTO Error1 
  type "\\spserver\myfolder\dt.tmp"|FIND "current"&gt;"\\spserver\myfolder\dt.log" 
  rem del "\\spserver\myfolder\dt.tmp"
  GOTO End 
  
  :Error1 
  Echo.  
  Echo There was an error processing the command.  
  Echo Unable to find temporary sort file DATETIME2.TMP.  
  Echo.  
  GOTO End 
  
  :End 
  </code></pre>