From: Patrick Spence Date: 2006-11-04T04:17:41+09:00 Subject: Re: counter Lucas Handelsman wrote: > Pretty new to ruby (and programming but am getting better). > > I am importing data with DBI and I want display and counter as each row > is imported. I can get the display to show: > > 1 > 2 > 3 > 4 > 5 > 6 > 7 > 8 > 9 > 10 > etc... > > but I don't want a linebreak after the counter is displayed. I want it > just to keep refreshing itself, basically. Am I missing something with > puts or print or p? Any ideas? 1.upto(50) {|index| print("\b" * index.to_s().length << index.to_s()) sleep(0.2) } -- Posted via http://www.ruby-forum.com/.