title: Need to copy the lines just before a particular string using batch file
body: <p>I have a file like this:</p>
  
  <pre><code>Executing resource: D:\waste2\SPC\depks_rtl_teller_custom.spc   
  Executing resource: D:\waste2\SPC\ifpks_msg_incoming_cluster.spc  
  Failed to execute:   
  Executing resource: D:\waste2\SQL\casapks_batch.sql  
  Failed to execute:  
  Executing resource: D:\waste2\SQL\depks_decbatop_kernel.sql  
  Executing resource: D:\waste2\SQL\depks_services.sql  
  Failed to execute:    
  </code></pre>
  
  <p>I need a batch file or perl script or ANT script to pick all the lines just in front of the string "Failed to execute:" and copy to a new file. Simply the failed file list I need in a new file. Please assist.</p>