< :the previous in number
^ :the list in numerical order
> :the next in number
P :the previous (in thread)
N :the next (in thread)
|<:the top of this thread
>|:the next thread
^ :the parent (reply-to)
_:the child (an article replying to this)
>:the elder article having the same parent
<:the youger article having the same parent
---:split window and show thread lists
| :split window (vertically) and show thread lists
~ :close the thread frame
.:the index
..:the index of indices
On Nov 24, 8:58 am, Robert Klemme <shortcut... / googlemail.com> wrote:
> 2007/11/23, Lee Jarvis <jarv... / gmail.com>:
>
> > > This is more efficient - no need to load the whole file into mem to
> > > find a single line:
>
> > > File.foreach "file.txt" do |line|
> > > if /rx/ =~ line
> > > puts "found it"
> > > break
> > > end
> > > end
>
> > > Cheers
>
> > > robert
>
> > Ahh, good point, touche my good man.
>
> While we're at it: there is another solution - probably a bit more elegant:
>
> require 'enumerator'
> File.to_enum(:foreach,"file.txt").grep(/rx/) {|li| puts li; break}
>
> :-)
>
> Kind regards
>
> robert
>
> --
> use.inject do |as, often| as.you_can - without end
That's Ruby beauty, express yourself in a way that suits you the most
and still we all can understand your dialect and enjoy.
Dima