laziness, impatience, and hubris | |
PerlMonks |
Re: (2) One-liner for Matching a Regex in a Directory of Filesby svsingh (Priest) |
on Jan 11, 2004 at 02:15 UTC ( [id://320412]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Seekers of Perl Wisdom
|
|