有点乱,可以试一下- @echo off&setlocal enabledelayedexpansion
- findstr /n . 2.txt>>3.txt
- set n=0
- :1
- set /a a=%random%%%200+1
- findstr /bc:"%a%:" 3.txt>>4.txt
- for /f %%i in (4.txt)do (findstr /xc:"%%i" 3.txt)>>3.txt
- )
- set /a n+=1
- if "%n%" equ "5" (goto :2) else goto 1
- echo 出现错误&pasue&goto :eof
- :2
- for /f "tokens=1* delims=:" %%i in (4.txt) do set /p a=%%i,<nul>>5.txt
- for /f "tokens=1-5 delims=," %%1 in (5.txt) do set b=%%1%%2%%3%%4%%5
- for /f "tokens=1* delims=:" %%i in (4.txt) do echo %%j >>%b%.txt
- del 3.txt&del 4.txt
- REM 如果感到%b%.txt有点乱,就看一下5.txt吧,原因是%b%的并不是行数从小到大的顺序
- pause
-
复制代码
|