ltx1993 当前离线
列兵
评分人数
pcl_test 当前离线
荣誉版主
TOP
@echo off findstr "a" "文本.txt">$1.tmp set /p #头=<$1.tmp sort /+65535 $1.tmp>$2.tmp set /p #尾=<$2.tmp echo;%#头% echo;%#尾% del /q /f $*.tmp pause复制代码
@echo off for /f "delims=" %%a in ('more +9 "%~f0"^|find "a"') do ( if not defined #尾 set "#头=%%a" set "#尾=%%a" ) echo;%#头% echo;%#尾% pause&exit ::举个栗子 a:1 fga a:2 a:3 afdsfa a:4复制代码