
CODE: [Copy to clipboard]setlocal enabledelayedexpansion
cd.>re.txt
for /f "tokens=1* delims=:" %%i in ('findstr /n "red" test.txt') do (
set/a num=%%i
set/a num+=3
)
for /f "tokens=1* delims=:" %%i in ('findstr /n ".*" test.txt') do (
set/a num2=%%i
if !num2!==!num! (
set str=%%j
echo !str!|findstr "apple">>re.txt || echo no apple >>re.txt
)
)
pause
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |