Sorting a Dictionary File
I have this dictionary file that has this format:
SUBSTITUTE_VALUE, Real Value
SUBSTITUTE_VALUE_2, Real Big Value
SUBSTITUTE_VALUE_HECL, Hardware Abstract
SUBSTITUTE_V, Valley Mem
I want to sort this file so the LONGEST Substitute Values are listed at the top ( so SUBSTITUTE_VALUE_HECL would be first in the list). Obviously I want to keep the related values tagging along with them, so the whole first line would be
SUBSTITUTE_VALUE_HECL, Hardware Abstract
Playing with sort
This has me pretty close:
sort dict.file -k1.1n,1
Last edited by dougp25; 11-01-2010 at 06:11 PM.
|