本帖最后由 guaiwu 于 2011-8-21 19:00 编辑
- @echo off
- setlocal enabledelayedexpansion
- set/a former=1,n=-1
- for /f "delims=" %%i in (22.txt) do set/a n+=1
- cls>nul 3>44.txt
- for /f "skip=1" %%i in (22.txt) do (
- set/a m+=1,now=%%i
- if not !m! equ %n% (set/a lastline=now-1) else set lastline=!now!
-
- set/p=!former!-!lastline!;<nul
- set former=%%i
- )
复制代码
|