Skip to content

Instantly share code, notes, and snippets.

@cmaxw
Created July 22, 2010 19:28
Show Gist options
  • Save cmaxw/486457 to your computer and use it in GitHub Desktop.
Save cmaxw/486457 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'rubygems'
require 'fastercsv'
meeting_times = []
FasterCSV.foreach("night.csv") do |row|
row[1].split(",").each do |time|
row[2].split(",").each do |day|
row[3].split(",").each do |loc|
meeting_times << "#{time.strip} #{day.strip} #{loc.strip}"
end
end
end
end
meeting_times_count = {}
meeting_times.each do |time|
meeting_times_count[time] ||= 0
meeting_times_count[time] += 1
end
meeting_times_count.sort {|a,b| b[1]<=>a[1]}.each {|time| puts "#{time[1]}: #{time[0]}"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment