Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Answer: how can i search a text file for a string and print every occurence of that string

by Hofmator (Curate)
on Jul 20, 2001 at 16:44 UTC ( #98391=categorized answer: print w/replies, xml ) Need Help??

Q&A > strings > how can i search a text file for a string and print every occurence of that string - Answer contributed by Hofmator

I normally wouldn't program that by hand. Depending on your operating system I would use a grep variant (on *nix) or find/findstr (on Win). Alternatively you can use the equivalent from the Perl Power Tools .

--Hofmator

  • Comment on Answer: how can i search a text file for a string and print every occurence of that string
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (14)
As of 2016-09-26 19:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (489 votes). Check out past polls.