From: jake kaiden Date: 2011-05-04T09:26:58+09:00 Subject: Re: Iterating over an Array of Hashes hi Peter - well, this is certainly no magic - but you could just make a temp array, and check each entry to make sure you like it before committing it to "b." there's probably a better way to do this, but here's what i came up with: a = [ '2011-01-01', '2011-01-02', '2011-01-03' ] b = [ { :x => "foo" }, { :x => "bar" }, { :x => "baz" } ] temp = [] a.each{|a_item| temp << {:date => a_item}} temp.each{|entry| unless entry.inspect.include?("02") #or something else more relevant idx = temp.index(entry) b[idx] = entry end } temp = [] p b #=> [{:date=>"2011-01-01"}, {:x=>"bar"}, {:date=>"2011-01-03"}] - j -- Posted via http://www.ruby-forum.com/.