我编写了这个脚本来替换文件中的行,但这需要很长时间。有没有办法加快速度?
@echo off
setlocal DisableDelayedExpansion
set INTEXTFILE=update.ver
set OUTTEXTFILE=update.txt
set SEARCHTEXT=93.184.71.27
set REPLACETEXT=93.184.72.27
set OUTPUTLINE=
for /f "tokens=1,* delims=¶" %%A in ( '"type %INTEXTFILE%"') do (
SET string=%%A
setlocal EnableDelayedExpansion
SET modified=!string:%SEARCHTEXT%=%REPLACETEXT%!
>> %OUTTEXTFILE% echo(!modified!
endlocal
)
del %INTEXTFILE%
rename %OUTTEXTFILE% %INTEXTFILE%
@echo off
setlocal DisableDelayedExpansion
set INTEXTFILE=update.ver
set OUTTEXTFILE=update.txt
set SEARCHTEXT=91.228.167.26
set REPLACETEXT=91.227.167.26
set OUTPUTLINE=
for /f "tokens=1,* delims=¶" %%A in ( '"type %INTEXTFILE%"') do (
SET string=%%A
setlocal EnableDelayedExpansion
SET modified=!string:%SEARCHTEXT%=%REPLACETEXT%!
>> %OUTTEXTFILE% echo(!modified!
endlocal
)
del %INTEXTFILE%
rename %OUTTEXTFILE% %INTEXTFILE%
@echo off
setlocal DisableDelayedExpansion
set INTEXTFILE=update.ver
set OUTTEXTFILE=update.txt
set SEARCHTEXT=91.228.166.13
set REPLACETEXT=91.227.166.13
set OUTPUTLINE=
for /f "tokens=1,* delims=¶" %%A in ( '"type %INTEXTFILE%"') do (
SET string=%%A
setlocal EnableDelayedExpansion
SET modified=!string:%SEARCHTEXT%=%REPLACETEXT%!
>> %OUTTEXTFILE% echo(!modified!
endlocal
)
del %INTEXTFILE%
rename %OUTTEXTFILE% %INTEXTFILE%
@echo off
setlocal DisableDelayedExpansion
set INTEXTFILE=update.ver
set OUTTEXTFILE=update.txt
set SEARCHTEXT=91.228.166.15
set REPLACETEXT=91.227.166.15
set OUTPUTLINE=
for /f "tokens=1,* delims=¶" %%A in ( '"type %INTEXTFILE%"') do (
SET string=%%A
setlocal EnableDelayedExpansion
SET modified=!string:%SEARCHTEXT%=%REPLACETEXT%!
>> %OUTTEXTFILE% echo(!modified!
endlocal
)
del %INTEXTFILE%
rename %OUTTEXTFILE% %INTEXTFILE%
请帮我