[ale] [OT] Variation of grep

Ed Cashin ecashin at noserose.net
Thu Mar 12 11:21:10 EDT 2009


On Wed, Mar 11, 2009 at 6:27 PM, JK <jknapka at kneuro.net> wrote:
...
> (Bring on the perl one-liners...)

My perl is rusty.  I can't remember it's equivalent to ruby's "scan".

ruby -e 'gets(nil).scan(/CUSTOMER.*?\/CUSTOMER/m).each {|i| puts i if
i =~ /STATE: WA/m }' /tmp/dat

That works fine unless /tmp/dat is big.  Does your current python
implementation slurp the whole input into memory like this one-liner?

-- 
  Ed Cashin <ecashin at noserose.net>


More information about the Ale mailing list