- @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%
复制代码
[ 本帖最后由 梦想种子 于 2008-4-25 21:33 编辑 ] |