Forum: Ruby Ruby Progress Catcher

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5e61720d66eb0a62a3f9b5948884d801?d=identicon&s=25 Carl s. (carl_s)
on 2013-06-05 03:13
So what I am asking how to do is have a script that reads all of the
lines in a text file, then in a loop have it print "Lines: (number its
on) and have this number increment by 1 until the text file is
completely empty. Thanks to all who attempt :)
E0d864d9677f3c1482a20152b7cac0e2?d=identicon&s=25 Robert Klemme (robert_k78)
on 2013-06-05 08:49
(Received via mailing list)
On Wed, Jun 5, 2013 at 3:13 AM, Carl s. <lists@ruby-forum.com> wrote:

> So what I am asking how to do is have a script that reads all of the
> lines in a text file, then in a loop have it print "Lines: (number its
> on) and have this number increment by 1 until the text file is
> completely empty. Thanks to all who attempt :)
>

I am not really sure what to make of this: reading does not modify the
file
so it cannot be "empty" after any amount of read operations.  Are you
maybe
just looking for numbering lines in a file?  Then I suggest

$ cat -n the_file

Kind regards

robert
Aa082c8b00a50928e5860dcd70bf2368?d=identicon&s=25 Tamara Temple (Guest)
on 2013-06-06 00:31
(Received via mailing list)
Carl s. <lists@ruby-forum.com> wrote:
> So what I am asking how to do is have a script that reads all of the
> lines in a text file, then in a loop have it print "Lines: (number its
> on) and have this number increment by 1 until the text file is
> completely empty. Thanks to all who attempt :)

What's in it for us?
This topic is locked and can not be replied to.