想判断一下行的内容,不符合的取下一行(倒着)。现在每次取到的都是haha,
代码:
@echo off
for /f "tokens=* delims=" %%b in (no.txt) do (
set no=%%b
)
:a
set /a no-=1
for /f "skip=%no% delims=" %%a in (a.txt) do (
set h=%%a
)
if %h:~0,2% neq 20 goto a
if %h:~0,2% equ 20 goto yes
:yes
echo yes
pause
no.txt内容(是a.txt的行数)
3
a.txt内容
2007-11-15 03-47-22
2007-11-15 08-32-59
haha
Last edited by andred0421 on 2007-11-16 at 09:49 AM ]