Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2014-07-10 18:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (215 votes), past polls