Is there an easy way to do that, or do we have to use a char map or tempfile for that.
Code: Select all
echo. C, B, A |%sort%
>A, B, C

Moderator: DosItHelp
Code: Select all
echo. C, B, A |%sort%
>A, B, C
Code: Select all
for /f %%a in ('^(for /f %%t in ^(!str!^) do @echo %%t^)^|sort %~2') do set "sorted=!sorted! %%a"
Code: Select all
for /f %%? in ( %$n1c%
'^^^^^( for %%? in ^^^^^(^^^!$str^^^!^^^^^) do @echo %%?^^^^^)^^^^^|sort' %$n1c%
) do set "$sorted=^!$sorted^! %%?" %$n1c%
Ed Dyreen wrote:I also don't understand why leaving out @ on echo suddenly shows the path, why is that ?
Code: Select all
@echo off
(for %%t in (c b a) do echo %%t)|more
Code: Select all
P:\>echo c
c
P:\>echo b
b
P:\>echo a
a
Code: Select all
@echo off
(for %%t in (c b a) do @echo %%t)|more
Code: Select all
@echo off
(echo off & for %%t in (c b a) do @echo %%t)|more