From: Tim Pease Date: 2006-11-08T03:07:39+09:00 Subject: Re: How to make a cycling counter from commandline? On 11/7/06, Carlos wrote: > > From my BBS years I remember adding... mmm... �"\033[K"? at the end of > the string when I did this kind of overwriting. That ANSI code (if I > remembered it correctly) clears everything until the end of line > --useful in case the new string is shorter than the overwritten one. > (This doesn't happen in this case, but maybe the OP wants to print > "#{total} record processed" afterwards.) > Yeah, that was the fatal flaw in my little post there. That is one very cool ANSI code though. I've used the color codes, but did not know about that one :) I just tried it out, and that is the correct code :) clear = "\e[K" print "a very long line of text that is longer than the next line" sleep 1 print "\rshort line of text#{clear}" sleep 1 print "\n" By the way "\e" == "\033" Blessings, TwP