From: "Jan E." Date: 2012-12-21T23:34:26+09:00 Subject: Re: trying to strip characters from a line Paul Mena wrote in post #1089856: > Thanks once again to everyone for their suggestions. It would be even better if you'd actually read them. :-/ What's the purpose of the "begin-end", by the way? This is not Pascal. A "begin-end" block only makes sense in combination with "rescue" or "ensure". Re-opening the file for every single row also doesn't really make sense. Either open the file *before* the loop or collect the row strings and then write them all at once. File.open("archive.html", "a") do |file| # I'm sure there's a better method for this, something like "each_row" n_rows.times do file << rs.fetch_row.to_s.delete('[]",') file.puts '
' end end -- Posted via http://www.ruby-forum.com/.