>>>>> lina  <[email protected]> writes:
>>>>> On Wed, Jul 27, 2011 at 1:36 PM, Ivan Shmakov wrote:

[…]

 >> $ sed -e 's/^\(\s*\w\+\s\+[^0-9[:blank:]]\+\)\([[:digit:]]\+\)/\1 \2/' \
 >>      | sort -nk 3,3 -k1,1 \
 >>      | sed -e 's/^\(\s*\w\+\s\+[^0-9[:blank:]]\+\)\s\([[:digit:]]\+\)/\1\2/'

 > Thanks, but there is another problem here, about the first field,
 > which I wish it can be consequentially (mainly keep it present
 > sequential), Here is the list, a bit longer,

        Somehow, I've had the -k options order reversed in the code
        above.  It should've read: … | sort -n -k 1,1 -k 3,3 | …
        instead.

        Note that there we're sorting numerically on the first field,
        too.  If that's undesirable, sort(1) is to be invoked twice,
        like: … | sort -n -k 3,3 | sort -s -k 1,1 | ….

[…]

-- 
FSF associate member #7257


-- 
To UNSUBSCRIBE, email to [email protected] 
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]

Reply via email to