::文件非空行数:
findstr/n . list.txt|find /c /v ""
::文件总行数(包括空行):
type list.txt|find /c /v ""
::另一种方法
@echo off&setlocal enabledelayedexpansion
for /f " delims=:" %%i in ('findstr /n .* "123.txt"') do set var=%%i
echo %var%
批处理统计文本行数::文件非空行数: findstr/n . list.txt|find /c /v "" ::文件总行数(包括空行):
::另一种方法 @echo off&setlocal enabledelayedexpansion echo %var% |
|
来自: caodaoquan > 《地法》