Hi,
i've got a big (300MB +) text file which needs to be split into two parts. The split point should be the first occurrence of a specific word, like this :
Since the file is big, line-by-line method is too slow, and if i put the whole contents into a buffer, i get the 'Out of Memory' error.
Any ideas how to do it in chunks?
i've got a big (300MB +) text file which needs to be split into two parts. The split point should be the first occurrence of a specific word, like this :
Code:
000000000000000000000000000000
000000000000000000000000000000
000000000000000000000000000000
000000000000000000000000000000
000000000000000000000000000000
000000000000000000000000000000 <--------------------------------------The end of the first file
THE WORD<-------------------------------------------------------------Split point
000000000000000000000000000000 <--------------------------------------The beginning of the second file
000000000000000000000000000000Since the file is big, line-by-line method is too slow, and if i put the whole contents into a buffer, i get the 'Out of Memory' error.
Any ideas how to do it in chunks?