Hi!
This is really more of a Ruby question than a Watir question, but I'll
give it a shot. :) I'm sure a Ruby guru could give you a better
answer.
You'll need to do some more digging for html specifics, but here's a
start:
resultsFile = "c:\\test\\reports\\OriginalFile.txt"
if File.exist?("c:\\test\\reports\\OriginalFile.txt")
#modify each line of your log file and save it to a variable
sContent
sContent = File.readlines(resultsFile, '\n')
sContent.each do |line|
#I use line.sub! here to substitute the text I want, but you
may need to use other string
#methods to add html tags to your text and more logic to add
the correct tags in the correct places
end
#create a new file, dump the contents of sContent to it and close
it
newFile = File.new("c:\\test\\reports\\NewFile.html", "w+")
newFile.puts sContent
newFile.close
end
I hope this helps!
-Tiffany