使用bat批处理即可,代码如下:( txt文件为123a.txt,批处理文件为RowLine.bat)
@echo off
set n1=1623
setlocal enabledelayedexpansion
for /f "skip=1622 delims=" %%i in (123a.txt) do (
set /a n1+=1
set /a endM=!n1!
if !endM! LEQ 1649 set "foo=%%i"
if !endM! LEQ 1649 echo !foo!
)>>op2.txt
效果如下: