Skip to content

Instantly share code, notes, and snippets.

@ocean
Created May 27, 2009 09:27
Show Gist options
  • Save ocean/118545 to your computer and use it in GitHub Desktop.
Save ocean/118545 to your computer and use it in GitHub Desktop.
#results.each do |row|
results.each_hash do |row|
# 'collect' enables handling of NULL/nil values
row = row.collect { |v| v.nil? ? "" : v }
#fname = row[0] + ".html"
fname = row["ID"] + ".html"
open(fname, 'w') do |f|
f.puts "<strong>Defendant</strong><br>"
#f.puts row[1] + "</p>"
f.puts row["Defendant"] + "</p>"
f.puts "<p><strong>Trading Name</strong><br>"
#f.puts row[0] + "</p>"
f.puts row["Trading_Name"] + "</p>"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment