@echo off&setlocal enabledelayedexpansion
set max=0
for /f "delims=" %%i in (a.txt) do (
set /a i+=1
call :split "%%i" !i!)
for /l %%i in (0 1 %max%) do (
for /l %%j in (0 1 !i!) do (
set t=!s_%%j_%%i!
if not "!t!" == "" if not "!t!" == " " echo !t!))
pause&exit
:split
set c=-1&set s=%~1
:next
set /a c+=1
if not "!s:~%c%,1!" == "" (
set s_%2_%c%=!s:~%c%,1!
goto next
) else if %c% gtr %max% set max=%c%
写了个。完后参看前辈们写的,发觉和terse的接近了。
刚才试着处理1K左右的不同文本,私下觉得这个是最快的。
Last edited by dreamseed on 2008-4-23 at 08:28 PM ]