拿去花吧~- @echo off
- set "待修改的文本文件路径=D:\test\"
- set "修改前的字符串=vl-list->string"
- set "修改后的字符串=abc"
-
- cd /d "%待修改的文本文件路径%"
- for /f "delims=" %%i in ('dir /b /a-d *.txt') do (
- (for /f "delims=" %%j in ('findstr /n .* "%%i"') do (
- set "s=%%j"
- setlocal enabledelayedexpansion
- set "s=!s:%修改前的字符串%=%修改后的字符串%!"
- set "s=!s:*:=!"
- echo;!s!
- endlocal
- ))>xx.tmp
- move xx.tmp "%%i"
- )
- pause
复制代码
|