Re: Help with sorting (fwd)


Subject: Re: Help with sorting (fwd)
From: Arthur Corliss (acorliss@nevaeh-linux.org)
Date: Tue Feb 24 2004 - 13:52:52 AKST


Greetings:

Looks like I misunderstood the problem. The final solution (which actually
works correctly) is to strip the delimiting characters (since we don't have
whitespace occurring in the fields), sort the lines, and reformat:

  sed "s/[',()]//g" $file | sort -n -k 3 | sed "s/\([^ ]*\)/'\1',/g" | \
    sed 's/^\(.*\),$/(\1),/'

This prints out the file's contents in ascending order numerically sorted by
the third field...

        --Arthur Corliss
          Bolverk's Lair -- http://arthur.corlissfamily.org/
          Digital Mages -- http://www.digitalmages.com/
          "Live Free or Die, the Only Way to Live" -- NH State Motto
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Tue Feb 24 2004 - 13:53:27 AKST