| @echo off | | set "old1=11111" | | set "new1=" | | | | pushd "%~dp0" | | for /f "delims=" %%i in ('dir /b /s /a-d 1.txt') do ( | | (for /f "delims=" %%a in ('findstr /n .* "%%i"') do ( | | set "str=%%a" | | setlocal enabledelayedexpansion | | set "str=!str:%old1%=%new1%!" | | echo=!str:*:=! | | endlocal | | ))>"1.cmd" | | move /y "1.cmd" "%%i" | | ) | | | | pauseCOPY |
这段代码 是替换所有的11111为空白
比如我想把1.txt里面的
11111
22222
33333
44444
这几行都删除 需要怎么写? |