联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
@echo off setlocal enabledelayedexpansion for /f %%i in (test.txt) do ( call :line %%i ) goto :eof :line del line.tmp set out= set aa= set ll=%1 :circle if not defined ll goto :eof set aa=%ll:~0,1% set ll=%ll:~1% >>line.tmp echo %aa% if not "%ll%"=="" goto :circle for /f %%a in ('sort line.tmp') do set out=!out!%%a >>out.txt echo %out%
@echo off for /f %%a in (test.txt) do ( call :rowSort %%a ) pause :rowSort set str=%1 for /f %%h in ('^(echo %str:~0,1%^&echo.%str:~1,1%^&echo.%str:~2,1%^&echo.%str:~3,1%^&echo.%str:~4,1%^)^|sort /r') do ( set /p=%%h<nul ) echo.
Originally posted by HAT at 2008-11-21 05:16 PM: 凑个热闹 [code]@echo off for /f %%a in (test.txt) do ( call :rowSort %%a ) pause :rowSort set str=%1 for /f %%h in ('^(echo %str:~0,1%^&echo.%str:~1,1%^&echo.%str:~2,1%^&e ...
Originally posted by tireless at 2008-11-21 22:32: 是一样的。也许 echo. 看起来更酷 :)
@echo off set "a=1"&set "b=2"&set "c=" set/p=这里是%%a%%的值:<nul&echo %a% set/p=这里是%%b%%的值:<nul&echo\%b% set/p=这里是%%c%%的值:<nul&echo/%c% set/p=这里是%%c%%的值:<nul&echo %c% echo.:::end:::&pause>nul