Skip to content

Instantly share code, notes, and snippets.

@taylorbrooks
Created September 12, 2012 23:40
Show Gist options
  • Save taylorbrooks/3710800 to your computer and use it in GitHub Desktop.
Save taylorbrooks/3710800 to your computer and use it in GitHub Desktop.
Parsing CSVs
# Finds CSV file
csv = File.open('lib/contacts.csv')
# Opens CSV to read rows
CSV.read(csv, headers: true).each do |row|
# Finds the churches that haven't been contacted
if row[4] != 'x'
puts "#{row.inspect}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment