返回列表 发帖
我来个  补齐字符方法   效率不怎么样
@echo off&setlocal enabledelayedexpansion
for /f "tokens=*" %%i in (1.txt) do call :lp %%i
for /l %%i in (1 1 %t%) do for /l %%j in (1 1 !%%il!) do set "%%iv=!%%iv! "
for /f "tokens=*" %%i in (1.txt) do call :lp0 %%i
pause&exit
:lp0
set/a n+=1
    if "%1"=="" set n=& echo %str1%&set str1=&goto :eof
    set "str=%1!%n%v!"
    call set "str1=%str1%%%str:~,!%n%l!%%"
shift
goto lp0
:lp
set/a n+=1
if not defined %n%l set %n%l=0
    if "%1"=="" set n=&goto :eof
    for /f "skip=1 delims=:" %%i in ('^(echo %1^&echo.^)^|findstr /o ".*"') do set m=%%i
    set t=%n%
    if %m% gtr !%n%l! set %n%l=%m%
shift
goto lpCOPY

TOP

返回列表