
CODE: [Copy to clipboard]如果要替换成别的,只需要将echo\[]>>new.txt修改即可。@echo off&Setlocal EnableDelayedExpansion
del new.txt 2>nul
for /f "tokens=1* delims=:" %%a in ('findstr/n .* "b.txt"') do (
set "str=%%b"
if "!str:~0,1!"=="[" (if "!str:~-1!"=="]" (echo\[]>>new.txt) else (echo\%%b>>new.txt)) else (echo\%%b>>new.txt)
)
start notepad.exe new.txt
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |