联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
sed "s/ /\n/g" a.txt | sort | gawk "{printf(\"%%s \",$0)}"
@echo off set str=10 02 03 06 05 07 for %%a in (%str%) do set .%%a=%%a for /f "tokens=2 delims==" %%a in ('set .') do echo %%a
@echo off set str=10 02 03 06 05 07 for %%a in (%str%) do set .%%a=%%a for /f "tokens=2 delims==" %%a in ('set .') do set /p =%%a <nul
@echo off&setlocal enabledelayedexpansion set str=10 02 03 06 05 07 for %%a in (%str%) do set .%%a=%%a for /l %%a in (1 1 10) do ( set "str=00%%a" set "str=!str:~-2!" if defined .!str! (set num1=!num1! !str!) else set "num2=!num2! !str!" ) >>1.txt echo !num1:~1! >>2.txt echo !num2:~1!
SET command invoked with just a variable name, no equal sign or value will display the value of all variables whose prefix matches the name given to the SET command. For example: SET P would display all variables that begin with the letter 'P'
@echo off setlocal enabledelayedexpansion set str=10 02 03 06 05 07 for %%a in (%str%) do set .%%a=%%a for %%a in (01 02 03 04 05 06 07 08 09 10) do ( if defined .%%a ( set num1=!num1! %%a ) else ( set num2=!num2! %%a ) ) >>1.txt echo !num1:~1! >>2.txt echo !num2:~1!