title: Batch script to find and replace a string in text file within a minute for files up to 12 MB
body: <p>I have written a batch script to replace a string in text file.</p>
  
  <p>Following is the script.</p>
  
  <pre><code>@echo off &amp;setlocal
  set "search=%1"
  set "replace=%2"
  set "textfile=Input.txt"
  set "newfile=Output.txt"
  (for /f "delims=" %%i in (%textfile%) do (
      set "line=%%i"
      setlocal enabledelayedexpansion
      set "line=!line:%search%=%replace%!"
      echo(!line!
      endlocal
  ))&gt;"%newfile%"
  del %textfile%
  rename %newfile%  %textfile%
  </code></pre>
  
  <p>But for a 12MB file, it is taking close to 7 min. I want it to be under a minute. Can we make use of <strong>find or findstr</strong> command to reduce the time taken?</p>