From: Ch Ba Date: 2008-12-21T00:54:41+09:00 Subject: Re: get first and last line from txt file - how? Yaser Sulaiman wrote: > I'm just wondering.. > Let's say that we only need to read the last line. Can we do that > without > reading the other lines? > > Regards, > Yaser Sulaiman It would work the same? Or do you mean without loading up the entire file? lines = IO.readlines("foo.bar") puts lines.last -- Posted via http://www.ruby-forum.com/.