Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: regexp match large file
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


Report this thread to moderator Post Follow-up to this message
Old Post
A Down View
12-28-04 01:56 AM


Re: regexp match large file
You could load the whole file into a string and go from there or, if it
is a big big file, read it in one line at a time.

As far as the matching part, I have asked for help on this topic in the
past so maybe a few links to recent discussion might help:

http://groups-beta.google.com/group...r />
archnow%3
DSearch+this+group%26&_doneTitle=Back+to+Search&&d#57ac337ed73b655f


http://groups-beta.google.com/group...r />
0caf2c9d4
45a9258


Report this thread to moderator Post Follow-up to this message
Old Post
ioneabu@yahoo.com
12-28-04 01:56 AM


Re: regexp match large file
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 Hack
er/

Report this thread to moderator Post Follow-up to this message
Old Post
Abigail
12-28-04 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Miscellaneous archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:35 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.