Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: (2) One-liner for Matching a Regex in a Directory of Files

by svsingh (Priest)
on Jan 11, 2004 at 02:15 UTC ( #320412=note: print w/replies, xml ) Need Help??


in reply to Re: One-liner for Matching a Regex in a Directory of Files
in thread One-liner for Matching a Regex in a Directory of Files

Sorry, I didn't mean to imply that that M was at the beginning of the file. Each text file is a separate essay and the acronym was just a word in the body of the file.

I combined ideas from both tips to come up with the following (semi-Perl) solution. Thanks for your help Paladin and allolex.

for %a in (*.txt) do @perl -ne "if (m/ (M[A-Z]{3}) /) { print qq($1\n); }" %a

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://320412]
help
Chatterbox?
[Corion]: A good daystart to everybody!
[GrandFather]: It's a good day end here Corion. The start was somewhat less than average!

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2017-08-24 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (365 votes). Check out past polls.

    Notices?