in reply to overwrite last line printed

Text editors are smart enough to show you all the contents of the file, even if your line endings are mac style.

If you want the file to not contain those status updates, you can seek backwards in the file and overwrite, or better yet, simply don't print those progress lines to the file in the first place.

I suggest printing the "Progress..." messages to STDERR, while the useful stuff goes to STDOUT and/or the file.