976235887 当前离线
列兵
TOP
回家路上 当前离线
少尉
@echo off & setlocal enabledelayedexpansion %1%~f0 :|sort&pause&exit /b for /f "delims=" %%i in (1.txt) do ( set /a line+=1,li=line%%2 if !li!==1 echo;%%i )复制代码
pcl_test 当前离线
荣誉版主
:先下载http://batch-cn.qiniudn.com/tool/gawk.exe @(gawk "NR%%2" "a.txt")|sort >"b.txt"复制代码
aa77dd@163.com (aa77dd@163.com)当前离线
禁止发言
@echo off & setlocal EnableDelayedExpansion if "%1"=="sub" ( for /f %%a in (a.txt) do ( set /a "t=1-t" if !t!==1 ( set "s= %%a" (echo;!s:~-20!) ) ) exit ) else ( >b.txt ( for /f %%a in ('cmd /c %0 sub ^| sort') do echo %%a ) ) start b.txt pause复制代码
flyinnet9 当前离线
@echo off setlocal enabledelayedexpansion set n=0 :s for /f "delims=" %%a in ('more +!n! a.txt') do ( echo %%a >>tmp set /a n=n+2 if "%%a" neq "" goto s ) sort tmp >2.txt del tmp /q复制代码
尘丶 当前离线
四级士官
@echo off&setlocal enabledelayedexpansion for /f "delims=" %%a in (a.txt) do ( set /a n+=1 set /a num=!n!%%2 if !num!==1 echo;%%a&set "shuzi=!shuzi!%%a " ) echo. for /l %%a in (0,1,100000) do ( for %%b in (!shuzi!) do ( if %%a==%%b echo;%%b>>2.txt ) ) pause复制代码