来一个列排序版的,用的是比较简陋的排序方式,列数一多就蛋疼了...- @echo off&setlocal enabledelayedexpansion
- for /f "tokens=1-3" %%a in (1.txt) do (
- set /a a=%%a,b=%%b,c=%%c
- for %%d in (c-b b-a c-b) do (
- for /f "tokens=1,2 delims=-" %%e in ("%%d") do (
- if !%%e! gtr !%%f! set /a %%e=!%%f!,%%f=!%%e!
- )
- )
- if not defined _!a!_!b!_!c! (
- echo %%a %%b %%c
- set _!a!_!b!_!c!=_
- )
- )
- pause
复制代码
|