My task is to open a large file in READ&WRITE mode and i need to search some portion of text in that file by searching starting and end
Using a buffer to read a bulk of file one time
There is one trick:
each time your read a new string into buffer, make sure it has a overlap of length l, which is the length of substring
l = length(substring);
while (not eof) do
begin
if find(buffer,substring) return TRUE;
buffer[0..l] = substring;
buffer[l+1, end] = read_new_chars_intobuffer;
end