::===========================================
::有一文本内容如下:
::a.txt
::你他娘的是谁?他娘的我不告诉你。
::你他娘的到底是谁?我他娘的还就不告诉那个他娘的你。
::论坛可是不允许用不文明用语的,请大家先把“他娘的”换成“TND”输出一遍,最后去掉这个不雅的词再输出一遍。
::===========================================
@echo off
setlocal enabledelayedexpansion
for /f "tokens=*" %%i in (a.txt) do (set num=%%i&&set num=!num:他娘的=TND!&&echo !num!)
pause>nul
for /f "tokens=*" %%i in (a.txt) do (set num=%%i&&set num=!num:他娘的=!&&echo !num!)
pause>nul
@echo off
setlocal EnableDelayedExpansion
for /f "delims=" %%a in (a.txt) do (
set file=%%a
set b=!file:他娘的=TND!
echo !b!>>b.txt
)
for /f "delims=" %%b in (b.txt) do (
set name=%%b
set c=!name:TND=!
echo !c!>>b.txt
)
pause
新手代码,但一定是我自己写的,求指教,谢谢!