Copilot
Your everyday AI companion
About 2,640,000 results
Results near Columbus, Ohio ·
    Upvotes6edited Mar 7, 2020 at 9:27

    Replace the filename.txt and search1/replace1 with your filename and the proper search/replace strings or text.

    Echo off
    set "textfile=filename.txt"
    set "tempfile=filenametemp.txt"
    (for /f "delims=" %%i in (%textfile%) do (
    set "line=%%i"
    setlocal enabledelayedexpansion
    set "line=!line:search1=replace1!"
    echo(!line!
    endlocal
    ))>"%tempfile%"
    del %textfile%
    rename %tempfile% %textfile%
    Content Under CC-BY-SA license
    Was this helpful?
  1. People also ask
  2. Find String and Replace: A Guide to Windows Batch

  3. String substitution and replacing in batch files - Dragon-IT

  4. DOS Batch - Find and Replace - DosTips

  5. CMD Variable edit replace - Windows CMD - SS64.com

  6. Batch Editing MS Word Documents – Find and Replace

  7. Some results have been removed