I have records with unpadded numbers I want to sort on. I can assume
some maximum length and go character by character:
... | sort -4 -3 -2 -1 | ...
but this gets pretty cumbersome when I have to pick it out of the middle
of the record (in my real-life case at hand, I'm sorting REXXVARS TOLOAD
output that includes stems that were built in bizarre orders and without
counters by another called program):
... | sort ws . substr -4 of substr w1 of af 1
substr -3 of substr w1 of af 1
substr -2 of substr w1 of af 1
substr -1 of substr w1 of af 1 | ...
Or, again assuming some maximum length, I can stick a padded copy of the
number on the left:
... | specs ws . w1 of af 1 1.4 right 1-* n | sort | not chop 4 | ...
Have I overlooked some more straightforward and more general method?
¬R