全部默认编码 ,不重复 ,包括空行 ,不保持原文出现顺序 | @echo off | | set "file=a.txt" | | set "out=b.txt" | | set hang=2000 | | powershell -c "get-random -Count %hang% -InputObject (gc -literalpath '%file%')" >"%out%" | | pause&exit/bCOPY |
全部默认编码 ,不重复 ,包括空行 ,保持原文出现顺序 | @echo off | | set "file=a.txt" | | set "out=b.txt" | | set hang=2000 | | powershell -c "$nice=gc -literalpath '%file%';$sai=$nice.length;$t=new-object int[] $sai;for($i=0;$i -lt $sai;$i++){$t[$i]=$i};$r=get-random -Count %hang% -InputObject $t;[Array]::Sort($r);foreach($i in $r){$nice[$i]}" >"%out%" | | pause&exit/bCOPY |
|