两种方法: 1.通过前面的字符串来确定赋值变量
@echo off
for /f "delims=: tokens=1,2*" %%a in (D:\dailybuild\SVNinfo.txt) do (
if "%%a"=="最后修改的修订版" set a=%%a:%%b
)
echo %a%
pause
2.如果确定它在第几行,用记数器来实现
@echo off
setlocal enabledelayedexpansion
for /f "delims=" %%a in (D:\dailybuild\SVNinfo.txt) do (
set /a n+=1
if !n!==5 set a=%%a
)