I have a Ruby script that outputs progress messages on the same line, using the carriage return character, like this:
print "\r#{file_name} processed."
As an example, the output changes from 'file001.html' processed.
to 'file002.html.' processed
and so on until the script completes.
I'd like to replace the last progress message with Done.
, but I can't just write print "\rDone."
because that piece of code outputs something like this:
Done.99.html processed.
I guess I have to empty the line after the last progress message and then print Done.
. How do I do that?