Home > Archive > PERL Miscellaneous > December 2004 > Re: regexp match large file
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: regexp match large file
|
|
| A Down View 2004-12-27, 8:56 pm |
| What's the easiest way to match regexp in an entire .txt file against a
set of keywords?
For example, a script that would search an e-mail for the words "hello"
"computer" "johnny" and then return the results?
Sorry if this question is a bit obtuse, I merely exploring an idea...
Thanks.
downview
| |
|
|
| Abigail 2004-12-27, 8:56 pm |
| A Down View (downview@gmail.com) wrote on MMMMCXXXVI September MCMXCIII
in <URL:news:1104184278.392223.79670@z14g2000cwz.googlegroups.com>:
'' What's the easiest way to match regexp in an entire .txt file against a
'' set of keywords?
''
'' For example, a script that would search an e-mail for the words "hello"
'' "computer" "johnny" and then return the results?
''
'' Sorry if this question is a bit obtuse, I merely exploring an idea...
'' Thanks.
$ grep 'hello|computer|johnny' e.mail
Or:
$ for w in hello computer johnny; do grep $w e.mail; done
Abigail
--
#!/opt/perl/bin/perl -w
$\ = $"; $; = $$; END {$: and print $:} $SIG {TERM} = sub {$ := $_}; kill 15 =>
fork and ($; == getppid and exit or wait) foreach qw /Just another Perl Hacker/
|
|
|
|
|