本帖最后由 尘丶 于 2015-8-10 17:21 编辑
二- @echo off&setlocal enabledelayedexpansion
- setlocal enabledelayedexpansion
- (for /l %%a in (1,1,30) do set/p n%%a=)<1.txt
- for /f "delims=" %%a in (1.txt) do (
- set num=%%a&set /a n+=1&set /a s=!n!-1&set /a k=!n!+1
- if "!num:~,4!"=="abcd" (
- call,echo;上一行:%%n!s!%%
- echo;%%a
- call,echo;下一行:%%n!k!%%
- )
- )
- pause
复制代码
|