windows批处理获取文件行数?用batch读取文件行数,我的思路是用for来循环读取然后记录,代码如下:
@ECHO OFFSETLOCAL ENABLEDELAYEDEXPANSIONSET lines=0IF "%1" == "" ECHO No Input File! & EXIT /BFOR /F "tokens=* delims=" %%i IN (%1) DO (SET /A lines=!lines!+1)ECHO 当前文件共 !lines! 行!