本帖最后由 xxpinqz 于 2013-7-3 19:22 编辑
或者不考虑随机数的顺序,效率会高一点
17233=50000-32767- @echo off&setlocal enabledelayedexpansion
- set "fn=all.txt"
- for /l %%a in (1,1,1020) do (
- set/a r=!random!+!random!%%17233+1
- set "var=!var!!r!: "
- )
- findstr /n .* "%fn%"|findstr /b "%var%" >tmp
- (for /f "delims=" %%i in ('dir /b /a-d *.txt') do (
- if not "%%i"=="%fn%" (
- (for /l %%a in (1 1 10) do (
- set/p str=
- echo,!str:*:=!
- ))>>"%%i"
- )
- ))<tmp
- del tmp
复制代码
|