Would you help me with this batch file . I'm trying to sort this table by column , but I don't what's the wrong to fix it. setlocal EnableDelayedExpansion for /F "tokens=1-6 delims=. " %%G in (FILE.TXT) do ( set N=0%%J set SORT[%%G%%H%%I!N:~-2!]=%%G.%%H.%%I.%%J %%L ) for /F "tokens=2 delims==" %%N in ('set SORT[') do echo %%N PAUSE the file text : ID Name Weight Long Class Age 012 Eric 56 156 7 13 045 Richard 78 178 9 17 098 Maya 60 164 10 16 072 Anna 56 152 8 14 034 Helena 76 169 11 18 022 Kevin 66 162 6 12 093 Peter 99 170 12 19 The Output I get 012 Eric 56 156 7 13 045 Richard 78 178 9 17
Would you help me with this batch file . I'm trying to sort this table by column , but I don't what's the wrong to fix it.
setlocal EnableDelayedExpansion
for /F "tokens=1-6 delims=. " %%G in (FILE.TXT) do (
set N=0%%J
set SORT[%%G%%H%%I!N:~-2!]=%%G.%%H.%%I.%%J %%L
)
for /F "tokens=2 delims==" %%N in ('set SORT[') do echo %%N
PAUSE
the file text :
ID Name Weight Long Class Age
012 Eric 56 156 7 13
045 Richard 78 178 9 17
098 Maya 60 164 10 16
072 Anna 56 152 8 14
034 Helena 76 169 11 18
022 Kevin 66 162 6 12
093 Peter 99 170 12 19
The Output I get
012 Eric 56 156 7 13
045 Richard 78 178 9 17
098 Maya 60 164 10 16
072 Anna 56 152 8 14
034 Helena 76 169 11 18
022 Kevin 66 162 6 12
093 Peter 99 170 12 19
ID Name Weight Long Class Age
Step by step
Solved in 3 steps with 5 images