Created
June 1, 2015 03:02
-
-
Save Andrelton/fdfdd728007f46922fdc 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
require 'csv' | |
friends = [] | |
File.open("hamburgler.txt", 'r') do |f| | |
f.each_line { |line| friends << line.chomp } | |
end | |
p friends | |
File.open("helicopter.txt", 'w') do |f| | |
friends.each do |item| | |
f.print item + " likes " | |
end | |
end | |
# CSV.foreach(filename, headers: true, header_converters: :symbol ) do |row| | |
# recipes << Hash[row] | |
# end | |
CSV.open("applesauce.csv", 'w') do |csv| | |
csv << friends | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment