[Note: parts of this message were removed to make it a legal post.]
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 <tonydema@gmail.com> 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 <tonydema@gmail.com> 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."