Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Returning line numbers of a string

by Old_Gray_Bear (Bishop)
on Aug 12, 2012 at 22:47 UTC ( #986989=note: print w/replies, xml ) Need Help??

in reply to Returning line numbers of a string

In pseudo-code:
open log-file set line-counter to 0 read the log-file a line at a time add one to the line-counter if the pattern is found, then then print "I found pattern at ", line-counter once the file is completely read, close log-file print "We Are Done!!" exit
Let us know when you get stuck implementing this in Perl.

I Go Back to Sleep, Now.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2016-10-26 10:21 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (340 votes). Check out past polls.