
CODE: [Copy to clipboard]或:@echo off
(for /f "delims=" %%a in (1.txt) do echo.%%a|findstr /ibv "SERVER_IP="||echo.SERVER_IP="123.456.789.123")>$&&move $ 1.txt
CODE: [Copy to clipboard]也可以使用第三方命令行工具,如fr、sed等:@echo off
(for /f "tokens=1* delims==" %%a in (1.txt) do if "%%b"=="" (echo.%%a) else if /i "%%a"=="SERVER_IP" (echo.%%a=="123.456.789.123") else echo.%%a=%%b)>$&&move $ 1.txt
CODE: [Copy to clipboard][ Last edited by Hanyeguxing on 2010-5-21 at 16:37 ]fr 1.txt -ric:"SERVER_IP=\"*.*.*.*\"" -t:"SERVER_IP=\"123.456.789.123\""
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |