Skip to content

Instantly share code, notes, and snippets.

@teejayvanslyke
Created October 12, 2010 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teejayvanslyke/622512 to your computer and use it in GitHub Desktop.
Save teejayvanslyke/622512 to your computer and use it in GitHub Desktop.
require 'csv'
path = 'db/registered_students_fall_2010.csv'
row_index = 0
created_after_9_1 = YAML::load_file('db/created_after_9_1.yml')
p created_after_9_1.size
results = []
CSV::Reader.parse(File.open(path)) do |row|
next if row[2] == 'email'
if !created_after_9_1.select {|r| r['email'] == row[2]}.empty?
results << row
end
end
results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment