in reply to Re: Associative Array Trouble
in thread Associative Array Trouble

cat test.txt | sed -e's/\(.*\) \(.*\)/\2,\1/g' | sort
And that would be not only a Useless Use of Cat, but not taking advantage of sort's field sorting abilities either:
$ sort +1 -2 +0 -1 <test.txt >output.txt

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
OT Re: &bull;Re: Re: Associative Array Trouble
by rbc (Curate) on May 23, 2002 at 16:46 UTC
    Hmmm ... maybe we can have a golf game?
    What would be shorter a shell script or a perl script?
    My money would be on the shell script. What do you think merlyn?