Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Pattern matching across two files, Need something better than grep -f!

by JavaFan (Canon)
on Apr 10, 2012 at 23:48 UTC ( #964424=note: print w/replies, xml ) Need Help??

in reply to Pattern matching across two files, Need something better than grep -f!

I have tried using grep -f, but it is taking a very long time to do this job
grep is optimized to do one job well. Unless you can make shortcuts because you know something special about the input which you can use, it's likely that any Perl solution isn't going to beat the grep one.

For instance, if the blocks of 18000 lines which share the first "token" are in the same order as the entries in pattern.txt, you can use this fact and make a much faster solution than just trying to match every line with every other.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://964424]
[Corion]: choroba: I avoided the "fun" of emergency shopping for a new flat iron by trying the flat iron without the timer that sat between it and the mains power. Seems as if just the timer is broken.
[Corion]: marto: Heh, would be cool!
Corion munches on the traditional German winter fruit, strawberries. Imported from Spain at the price of EUR 0.77 per 150g - not really cheap but surprisingly good for a winter produce

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2017-01-20 10:21 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (174 votes). Check out past polls.