good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Searching in binary filesby zentara (Archbishop) |
on Dec 15, 2005 at 12:32 UTC ( [id://516935]=note: print w/replies, xml ) | Need Help?? |
How about a "sniffing dog" approach(or fingerprints?). Break your search string into small fragments, but long enough to be fairly unique. Then search for those fragments in a small sliding chunks of the big file. If a fragment is found, check to see if the adjacent fragments are there. If the fragment is found near the beginning or end of the sliding chunk, load in the appropriate adjacent chunk and retest.
I'm not really a human, but I play one on earth. flash japh
In Section
Seekers of Perl Wisdom
|
|