本帖最后由 cobat 于 2015-4-2 10:51 编辑
- @echo off
- setlocal enabledelayedexpansion
- set "name=【蛮荒记】"
- set/a "z=999<<10,n=101"
- for /f "tokens=1* delims=:" %%a in ('findstr /o .* %name%.txt') do (
- if not defined k (set k=1) else (
- if %%a gtr !z! set/a "z+=%z%,n+=1"
- >>%name%!n:~1!.txt echo,!ln!
- )
- set "ln=%%b"
- )
- >>%name%%n:~1%.txt echo,%ln%
- pause
复制代码
|