From: "David A. Black" Date: 2009-02-04T07:23:16+09:00 Subject: Re: Hash counting Hi -- On Wed, 4 Feb 2009, Stuart Clarke wrote: > Thanks for your response. It makes a lot more sense and you are on the > right lines I think. There is other code around this but it does not > bare much relevance: > > def scanEVTWithSource(file, source) > @alerts = [] > @evtLogArray = [] > begin > #read the contents of the event logs files > evtLog = EventLog.open_backup(file, source) > > #put data into an array > @evtLogArray = evtLog.read.sort { |a, b| (a.event_id <=> > b.event_id).nonzero? || (a.time_written <=> b.time_written)} I haven't really been following this thread but this caught my eye and I thought I'd mention this other technique: array.sort_by {|e| [e.event_id, e.time_written] } David -- David A. Black / Ruby Power and Light, LLC Ruby/Rails consulting & training: http://www.rubypal.com Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2) http://www.wishsight.com => Independent, social wishlist management!