Quantcast
Channel: Take Command / TCC
Viewing all articles
Browse latest Browse all 1868

Str2lst - Convert a string to a list

$
0
0
I have the need to sort a string of numbers, so I came up with the Str2lst alias;
Code:
R:\>which str2lst
str2lst is an alias : echo %@replace[ ,^n,%$]

I use it thus;
Code:
R:\>str2lst 1961 1210 2025 1995 1990
1961
1210
2025
1995
1990

Sorted;
Code:
R:\>str2lst 1961 1210 2025 1995 1990 | xsort /type=0
1210
1961
1990
1995
2025

Reverse sorted;
Code:
R:\>str2lst 1961 1210 2025 1995 1990 | xsort /type=0 /r
2025
1995
1990
1961
1210

Ref: XSORT - Pipe fitting to copy stdin and file(s)...

Read more

Viewing all articles
Browse latest Browse all 1868

Trending Articles