0

below is my ruby script

require "rubygems"
require 'csv'

a = Array.new
CSV.foreach("p34n234.csv") do |row|
    a << row
end

print a

What i want to do is now at the end I want to generate a html file and print array to it.

I hope i made sense.

Thanks

P.S I just want to show the array in a .html file. Nothing fancy here:)

1 Answer 1

1

I guess you would be doing something like this...

print "HTTP/1.0 200 OK\r\n"
print "Content-type: text/html\r\n\r\n"
print "<html><body>#{your_array}</body></html>\r\n"
Sign up to request clarification or add additional context in comments.

1 Comment

yep makes sense. did with puts and a little different thout.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.