Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: how to open all file one by one

by graff (Chancellor)
on Apr 12, 2013 at 02:52 UTC ( #1028262=note: print w/ replies, xml ) Need Help??


in reply to how to open all file one by one

Are you sure you need perl for this? It sounds like all you need is the unix/linux/macosx "grep" utility (available for windows - just google "ms-windows grep")

grep critical *.txt
That will show you every line from every *.txt file that contains the word "critical". If all you want is the list of file names, use the "-l" option:
grep -l critical *.txt
If there's more you want to do, perl might be useful for that (or there might be another unix/linux/osx tool that does what you want...)


Comment on Re: how to open all file one by one
Select or Download Code
Re^2: how to open all file one by one (ack)
by Anonymous Monk on Apr 12, 2013 at 03:36 UTC
    :)ack is a perl replacement for grep
      it looked like a bit difference. I want to know how to open every file and scan inside the file word which if detect "critical :xxxxx" then will send out this file for the admin.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (11)
As of 2015-07-07 14:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (90 votes), past polls