修改下 batman兄 6楼代码
用最大行字数减当前行字数 处理怎么样
另type 改为 more 省了最后行问题- @echo off&setlocal enabledelayedexpansion
- for /f "tokens=1* delims=:" %%i in ('"(more "a.txt"&echo;)|findstr /o .*"') do (
- set /a n=%%i-2-m,m=%%i
- if !n! gtr !c! set c=!n!
- if defined var set _!l!=!var!&set l!l!=!n!
- if not "%%j"=="" (set "var=%%j"&set/a l+=1)else set "var="
-
- )
- for /l %%a in (1,1,%c%) do set "k=!k! "
- (for /l %%a in (1,1,%l%) do (
- set /a m=c-l%%a
- if "!_%%a!" neq "" for %%b in (!m!) do echo !_%%a!!k:~,%%b!,
- ))>new.txt
- start new.txt
复制代码
[ 本帖最后由 terse 于 2009-8-9 12:53 编辑 ] |