[CMS-PIPELINES] SORT PAD LEFT

2010-02-04 Thread Glenn Knickerbocker
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

Re: [CMS-PIPELINES] SORT PAD LEFT

2010-02-04 Thread Schuh, Richard
I may be a little dense, but how does this > > ... | sort -4 -3 -2 -1 | ... > Differ from ... | sort -4;-1 |...? Or this: > > ... | 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 >

Re: [CMS-PIPELINES] SORT PAD LEFT

2010-02-04 Thread Rich Greenberg
On: Thu, Feb 04, 2010 at 06:17:58PM -0500,Glenn Knickerbocker Wrote: } I have records with unpadded numbers I want to sort on. I can assume } some maximum length and go character by character: [...] } Or, again assuming some maximum length, I can stick a padded copy of the } number on the left:

Re: [CMS-PIPELINES] SORT PAD LEFT

2010-02-04 Thread Glenn Knickerbocker
On Thu, 4 Feb 2010 16:21:23 -0800, Richard Schuh wrote: >I may be a little dense, but how does this >> >> ... | sort -4 -3 -2 -1 | ... >> >Differ from ... | sort -4;-1 |...? Consider a record shorter than 4 characters. -4;-1 starts with the first character of the record. -4 -3 -2 -1 starts