Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: how to search for a string in large file?

by oiskuu (Friar)
on Mar 18, 2014 at 18:22 UTC ( #1078845=note: print w/ replies, xml ) Need Help??


in reply to how to search for a string in large file?

perl -ne '$n += () = /foo/g }{ print $n' <(< large.txt fgrep foo)
Though this might not cover them all. Should "foof" match "foofoof" once or twice?


Comment on Re: how to search for a string in large file?
Download Code
Re^2: how to search for a string in large file?
by littlemonk (Sexton) on Mar 18, 2014 at 18:55 UTC
    could please explain me the answer .. im new to perl!! :(

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1078845]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2014-12-27 04:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls