- Viewed 34k times6edited 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 offset "textfile=filename.txt"set "tempfile=filenametemp.txt"(for /f "delims=" %%i in (%textfile%) do (set "line=%%i"setlocal enabledelayedexpansionset "line=!line:search1=replace1!"echo(!line!endlocal))>"%tempfile%"del %textfile%rename %tempfile% %textfile%Content Under CC-BY-SA license Explore further
Find String and Replace: A Guide to Windows Batch
String substitution and replacing in batch files - Dragon-IT
- People also ask
Overview - Find and Replace
DOS Batch - Find and Replace - DosTips
Batch Script - Replace a String - GeeksforGeeks
Batch Editing MS Word Documents – Find and Replace
- Some results have been removed