回复 9# apang
借你代码小改一下- @echo off
- echo %time%
- setlocal enabledelayedexpansion
- (for /l %%a in (0 1 9) do (
- set /a a=%%a+1&for /l %%b in (!a! 1 9) do (
- set /a b=%%b+1&for /l %%c in (!b! 1 9) do (
- set /a c=%%c+1&for /l %%d in (!c! 1 9) do (
- set /a d=%%d+1&for /l %%e in (!d! 1 9) do (
- echo _%%a+_%%b+_%%c+_%%d+_%%e
- ))))))>$1
-
- (for /l %%b in (1 1 4) do (
- set /a m=%%b+1
- for /l %%c in (!m! 1 4) do (
- echo s1=.%%b+.%%c,s2=.%%b-.%%c,s3=.%%b*.%%c
- )
- ))>$2
- endlocal
-
- for /f "delims=" %%i in ('dir /a-d /b *.txt') do (
- md "New\%%~ni\" 2>nul
- for /f "tokens=1*" %%j in (%%i) do (
- setlocal enabledelayedexpansion
- set n=1
- for %%a in (%%k) do set /a .!n!=%%a,n+=1
-
- for /f %%a in ($2) do (
- set /a %%a
- set /a "_!s1:~-1!+=1,_!s2:~-1!+=1,_!s3:~-1!+=1"
- )
-
- set /a n=1,m=0
- for /f %%a in ($1) do (
- set /a m+=1,s=%%a
- set str=!str! !s!
- if !m! equ 42 (
- echo>>"New\%%~ni\%%~ni_!n!.txt" %%j!str!
- set "str="&set /a n+=1,m=0
- )
- )
- endlocal
- )
- )
- echo %time%
- del $?&pause
复制代码
|