Originally posted by Nickey at 2007-9-30 01:56:
echo 第%times%次猜%UserInput%>>Temp.txt
Temp.txt 内容
第1次猜30
第2次猜40
第3次猜50
第4次猜60
当times=4时
请问如何取上一次(即第3次的值 50)呢 ...
for /f "delims= tokens=1,2* skip=2" %%a in ('find /n temp.txt') do (
set x=%a
if "!x!" equ "!times!" &&set /a output=x-1 &goto :eof
)
echo 上一次的值为 %output%.
不知道符不符合你的要求!
没有测试,有问题跟帖!