Forum: Ruby Ruby Progress Catcher

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?
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.