exception while Read very large file > 300 MB

前端 未结 5 2086
时光取名叫无心
时光取名叫无心 2020-12-17 08:04

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

5条回答
  •  清歌不尽
    2020-12-17 08:41

    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

提交回复
热议问题