Skip to content

Instantly share code, notes, and snippets.

@ChrisLTD
Created April 14, 2011 17:13
Show Gist options
  • Save ChrisLTD/919955 to your computer and use it in GitHub Desktop.
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
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