On Thursday, December 02, 2010 10:20:47 am Daniel Taylor wrote: > On 12/02/2010 12:03 AM, gregwm wrote: > > how do you tell sort to ignore the first x characters of each line and > > start the key at character x+1? > > That would be "sort -t'*' -k 1.9" if I understand it correctly. > > Replace '*' with something else if it might appear in the characters to > be skipped. -t isn't needed in this case. sort -k 1.x, where x is the character position you want to sort on, counting from 1. You might want to check how it behaves if you have lines starting with whitespace, that's the edge case that might blow it up. Another edge case would be if you sort on character 4 and have a 3 character word followed by a space. Not sure how it would react to that. -- Thanks, Josh Paetzel -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 488 bytes Desc: This is a digitally signed message part. Url : http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20101202/b9bc4221/attachment.pgp