本帖最后由 Nsqs 于 2016-12-26 01:08 编辑
- @echo off&setlocal enabledelayedexpansion
- for %%1 in (*.txt)do (set /a b+=1
- for /f "delims=" %%2 in (%%1)do (
- call set /a #c_%%b%%+=1
- call set #a_%%b%%_%%#c_!b!%%=%%2
- )
- for /l %%3 in (1 1 2)do (
- call set /a d%%3=%%random%% %%%% %%#c_!b!%%+1
- )
- )
- (for /l %%1 in (1 1 %b%)do (
- for /l %%2 in (1 1 2)do (
- call echo %%#a_%%1_!d%%2!%%
- )
- ))>new.txt
- sort<new.txt>@&move "@" "new.txt">nul
复制代码 表示你的思路无法理解,其实用数组很简单 |