Created
April 14, 2011 17:13
-
-
Save ChrisLTD/919955 to your computer and use it in GitHub Desktop.
Read a two column CSV file and output it into an html file
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' | |
htmlfile = File.new "output.html", "w" | |
csvfile = CSV.read "input.csv" | |
csvfile.each do |x,y| | |
htmlfile.puts "<h1>#{x}</h1>\n<p>#{y}</p>\n\n" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment