Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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...)

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1028262]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2018-04-26 17:26 GMT
Find Nodes?
    Voting Booth?