
CODE: [Copy to clipboard]@echo off
setlocal enabledelayedexpansion
for /f "tokens=1* delims=:" %%i in ('findstr /n .* a.txt') do set max=%%i
for /f "delims=" %%a in (b.txt) do call :couq&echo %%a!num!
pause
exit
:couq
set /a sui=%random%%%%max%+1
for /f "tokens=1* delims=:" %%i in ('findstr /n .* a.txt') do (
if "%%i"==!sui! set num=%%j&goto :eof
)
goto :eof
CODE: [Copy to clipboard]setlocal enabledelayedexpansion
for /f "delims=" %%a in (A.txt) do (
call :loop
echo %%a!str_temp!>>C.txt
)
:loop
set /a rand_num=%random%%%5+1
set num=1
for /f "delims=" %%i in (B.txt) do (
if !num!==%rand_num% (
set str_temp=%%i
goto :eof
)
set /a num=!num!+1
)
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |