From: nobu.nokada@... Date: 2001-12-29T04:05:15+09:00 Subject: [ruby-talk:29569] Re: How to sort " sort -k3,3 -k9,9 file" At Sat, 29 Dec 2001 03:15:21 +0900, desibtis@hotmail.com (Sang DeSibtis) wrote: > Thanks, I try and it doesn't work. I add a bang at the end of > array.collect! but nothing got sorted. I am running Ver.1.6.5 > , does that matter? BTW, I can't locat Ver. 1.7 to try another > command you provided. Do you want to sort array itself? Then, put !'s at the ends of both of collect's. My example would produce a sorted new array. array.collect! {|s| [s[2], s[8], s]}.sort.collect! {|s| s.last} And the source of ruby 1.7 is avaiable via CVS. See http://www.ruby-lang.org/en/cvsrepo.html Nobu Nakada