Skip to content

Instantly share code, notes, and snippets.

@allthetime
Created September 10, 2014 02:20
Show Gist options
  • Save allthetime/5f82e31ecccbd5ed623c to your computer and use it in GitHub Desktop.
Save allthetime/5f82e31ecccbd5ed623c to your computer and use it in GitHub Desktop.
#READ CSV AND DUMP TO ARRAY
contacts_db = []
CSV.foreach('contact_list.csv') do |row|
contacts_db << row
end
contacts_db
#OPEN CSV FOR WRITING
c = CSV.open('contact_list.csv', 'wb')
#WRITE ARRAY TO CSV FILE LINE BY LINE
contacts.each_with_index do |row,i|
c << row
end
@Zynkh
Copy link

Zynkh commented Sep 10, 2014

love it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment