Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by oiskuu (Hermit)
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?

Replies are listed 'Best First'.
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 studying the Monastery: (4)
As of 2016-08-30 06:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (411 votes). Check out past polls.