Created
September 10, 2014 02:20
-
-
Save allthetime/5f82e31ecccbd5ed623c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
love it.