broly (Broly)当前离线
版主
@echo off setlocal enabledelayedexpansion for %%a in (gj.txt 58.txt) do ( set n=0 FOR /F "delims=" %%i in (%%a) do ( set "L=%%i" set NL=!L:/=;! FOR %%j in (!NL!) do ( set/a n+=1 >>cp!n!.txt echo=%%j ) ) )复制代码
TOP
danny123 当前离线
列兵
原帖由 zm900612 于 2011-2-12 22:08 发表 @echo off&setlocal enabledelayedexpansion for %%f in (gj.txt 58.txt) do ( set n= for /f "delims=" %%a in (%%f) do ( set tmp=%%a&set tmp=!tmp:/=" "! for %%i in ("!tmp!") do set /a ...
CrLf 当前离线
论坛巡查
@echo off&setlocal enabledelayedexpansion for %%f in (gj.txt 58.txt) do ( set n= for /f "delims=" %%a in (%%f) do ( set tmp=%%a&set tmp=!tmp:/=" "! for %%i in ("!tmp!") do set /a "n+=1"&set .%%f!n!=%%~i ) ) for /l %%a in (1 1 %n%) do ( echo !.gj.txt%%a! echo !.58.txt%%a! )>>%%a.txt pause exit复制代码
cutebe 当前离线
上尉
:换分隔符后用一般FOR来处理 @echo off setlocal enabledelayedexpansion FOR /F "delims=" %%i in (gj.txt,58.txt) do ( set "L=%%i" set NL=!L:/=;! FOR %%j in (!NL!) do ( set/a n+=1 >cp!n!.txt echo=%%j ) )复制代码
@echo off for %%a in (gj.txt 58.txt) do ( set n=0 for /f "tokens=1,* delims=/" %%i in (%%a) do call :sub %%i %%j ) pause exit :sub set /a n+=1 >>cp%n%.txt echo %1 if not "%2"=="" ( for /f "tokens=1,* delims=/" %%i in ("%2") do (call :sub %%i %%j) )复制代码
原帖由 broly 于 2011-2-12 21:00 发表 for循环中tokens(列)的极限数是31