Was [NTB] Sorting inline numbers
- View SourceHi Amitava and Adrian,
Oh Fine, I just noticed this is on the general list and not the clip
list. I'll send this to you folks private eMail and also to the clip
I got home today, and created a clip which sorts numbers well.
I'm not sure it is the most efficient way to do it but it makes numbers
come out just like we expect them to and as long as the list is less
than about a hundred is pretty fast.
I have not tested it with alphanumeric values, but expect it to not like
^!SetListDelimiter ", "
^!If ^%i%>^%alpha0% writeit
^!If ^%alpha^%i%%>^%beta^%q%% notyet ELSE NEXT
^!Set %beta^%q%%=^%alpha^%i%%, ^%beta^%q%%
^!If ^%q%>^%beta0% NEXT ELSE inqloop
^!Set %beta^%beta0%%=^%beta^%beta0%%, ^%alpha^%i%%
Adrian/ Rosemary Worsfold wrote:
> Don't think I'm on the clips list so just replying. This does work, but
> again not for numbers. The clip that should precede it would find the
> longest number before a comma, count it and add zeros in front of all
> others to so that all numbers were the same number of digits. Beyond me.
> H="Sort comma delimited list"
> ^!Keyboard CTRL+A
> ^!Replace " " >> "" [HAS]
> ^!Replace "," >> "^P" [HAS]
> ^!Keyboard SHIFT+CTRL+J
> ^!Keyboard ALT+M L S A
> ^!Keyboard CTRL+END
> Add from clipboard.
> Adrian Worsfold