So, I hope this is an appropriate forum for this. Here goes:
I have this program that prints out a status bar to (presumably) a terminal. Thus, it prints the following:
Code: Select all
[.................] 0%\r[#####.......] 50%\r[#########] 100%\n
It looks pretty decent on a terminal, but the problem is this is part of a nightly cron-job which gets emailed to me and a few other admins. And it actually prints out basically each percentage. So what should be 12 line email(at tops) is like a couple hundred lines and incredibly obnoxious. Honestly I'd rather write a Python parser for the real xml logfile the program outputs... but I need to get some stuff actually done, and I want it to stop annoying me in the mean time. Can anyone spot a regular expression or have already written a program to reduce it down to the final status, what it'd look like on the terminal?