From: Christian Date: 2008-03-29T15:18:44+09:00 Subject: Re: Help on best way to gather/sort results ? ------=_Part_9735_4726408.1206771522210 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Does the sort work if you just put in the sourceip? Say, you did @results << "#{sourceip}", and then used @results.sort. Does it still not sort? On Sat, Mar 29, 2008 at 4:14 PM, Tony De wrote: > Christian wrote: > > Wouldn't you want something like @results.sort {|x, y| y[1] <=> x[1]}? > > > > On Sat, Mar 29, 2008 at 3:49 PM, Tony De wrote: > > > >> >> > >> > >> Ok, tried this @results.sort_by { |a| a[1] } - thinking that I want to > >> sort on the second element in my array "Source". No sort was performed > >> at all. Scratching my head.. > >> > >> tonyd > >> -- > >> Posted via http://www.ruby-forum.com/. > >> > >> > > > > > > -- > > > > "Every child has many wishes. Some include a wallet, two chicks and a > > cigar, > > but that's another story." > > > Just tried that. No sort. Just for ref. My array struct looks like > this: > @results << ["#{file}", "#{sourceip}", "#{email}", "#{subject}"] > > I want to sort on sourceip. Thanks guys. > > > -- > Posted via http://www.ruby-forum.com/. > > -- "Every child has many wishes. Some include a wallet, two chicks and a cigar, but that's another story." ------=_Part_9735_4726408.1206771522210--