Finding a text in raw data(size nearly 10GB) and Printing its memory address using python
On Tuesday, April 24, 2018 at 1:28:07 AM UTC+5:30, Paul Rubin wrote:
> Hac4u <samakshkaushik at gmail.com> writes:
> > I have a raw data of size nearly 10GB. I would like to find a text
> > string and print the memory address at which it is stored.
> The simplest way is probably to mmap the file and use mmap.find:
Thanks alot Buddy,
And yea I will try to convert it in mmap..
Ur code helped alot. But I have few doubts
1. What is the use of overlap.
2. Ur code does not end..Like it does break even after searching through the entire file.
Bdw, I modified your code..
overlap_length = search_length - 1
with open(filename, 'rb') as f:
if not data:
# print offset
if offset < 0:
print "Found at",hex(chunk_start+offset)
chunk_start += len(data)