"be consistent" | |
PerlMonks |
Fastest way to get byte offsets of a string using tellby chanakya (Friar) |
on Mar 12, 2009 at 12:32 UTC ( [id://750144]=perlquestion: print w/replies, xml ) | Need Help?? |
chanakya has asked for the wisdom of the Perl Monks concerning the following question:
Monks, I have a sample script to get the byte offset of a given string from an archive file. The script reads a large archive file around 200GB and gets the byte offset at which the string was found. Below is the sample script. This basically reads the archive file, which is a collection of email messages. These email messages start with string "From " and end with a blank line. The marker here is "From" for every email The syntax of the archive file is as below. Basically I want a script do the following 1) Should get the Subject and the byte offsets of every email from the archive(offset of "From " and offset of End of email) 2) The script should be very fast to read the archive files and print out the information Please suggest the best possible ways to achieve the same. I want the script to complete the processing in the minimum time possible. Thanks for your time.
Back to
Seekers of Perl Wisdom
|
|