- @echo off
- if defined 源目录 goto :tow
- setlocal enabledelayedexpansion
-
- pushd %~dp0
- set 源目录=sour
- set 结果=dest
- for %%a in (%源目录%\*.txt) do (
- for /f "tokens=1*" %%b in ('%0 "%%a"^|sort') do (
- echo;%%c>>%结果%\%%~nxa
- )
- )
- pause
- goto :eof
-
- :tow
- for /f "tokens=*" %%a in (%~1) do (
- echo !random! %%a
- )
- cd.>%结果%\%~nx1
- goto :eof
复制代码
|