回复 8# echobat
我不是版主
整个文件夹文件不是很大的话 改一下- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%a in ('dir /a-d /b *.txt') do (
- (for /f "usebackqdelims=" %%i in ("%%a") do echo !random!!random!!random! %%i)>"%temp%\$"
- sort /o "%temp%\#" "%temp%\$"
- (for /f "usebackqtokens=1*" %%i in ("%temp%\#") do echo %%j)>"!random!!random!!random!_%%a"
- )
- del "%temp%\#" "%temp%\$"
- pause
复制代码 也可以试下这样- @if(0)==(0) echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%a in ('dir /a-d /b *.txt') do (
- cscript -nologo -e:javascript %0 <"%%a" >"!random!!random!!random!_%%a"
- )
- pause&exit /b
- @end
- var arr = WScript.StdIn.ReadAll().split("\n");
- var arr = arr.sort(function (a,b){return Math.random() >= 0.5 ? 1 : -1});
- WScript.echo(arr.join('\n'));
复制代码
|