Skip to content

Instantly share code, notes, and snippets.

@damon
Created January 6, 2010 17:30
Show Gist options
  • Save damon/270440 to your computer and use it in GitHub Desktop.
Save damon/270440 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
begin
require 'rubygems'
require 'fastercsv'
fn,result = ARGV[0],{}
FasterCSV.foreach(fn) do |row|
d,p = row[0],row[1]
result[d] = 0 if !result[d]
result[d] += 1 if p.strip.upcase=="TRUE"
end
result.each_pair do |d,c|
puts "#{d},#{c}"
end
rescue Exception => e
puts "Hey - you really need to do sudo gem intall fastercsv first...Oh yeah, and pass in a filename too..."
puts e
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment