From: Xavier Noria Date: 2012-12-26T18:58:24+09:00 Subject: Re: Accumulate total count for each month If that is all there is to it, a simple split would work nevents = Hash.new(0) ARGF.each_line do |line| month, year = line.chomp.split.values_at(1, -1) nevents["#{year} #{month}"] += 1 end