- @echo off&setlocal enabledelayedexpansion
- set /a offset=0,len=0,max=0
- for /f "tokens=1,2* delims=:" %%a in ('findstr /N /O .* 文本.txt') do (
- set /a len=%%b-offset,offset=%%b
- set "#%%a=%%c"
- if !len! geq !max! (
- set /a max=len,row=%%a-1
- for %%K in (!max!) do set "_%%K=!_%%K!,!row!"
- )
- )
- for %%a in (!_%max%!) do echo,行数【%%a】,长度【%max%】,内容【!#%%a!】
- pause
复制代码
|