Skip to content

Instantly share code, notes, and snippets.

@mlooney
Created July 15, 2016 15:23
Show Gist options
  • Save mlooney/e6df5b52c5ffd2817341aa834fd58934 to your computer and use it in GitHub Desktop.
Save mlooney/e6df5b52c5ffd2817341aa834fd58934 to your computer and use it in GitHub Desktop.
require 'csv'
k = CSV.open('report.csv', :headers=>:skip).map do |r|
z = r.to_hash.values
[z.shift, z.map(&:to_i).select{|x| x!=0}.inject(0){|m,_|m+=1}]
end
puts k.select{|_,v| v == 0}.map{|y,_| y}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment