Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 22109

Split large text file in two, according to delimiter

$
0
0
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 :


Code:

000000000000000000000000000000
000000000000000000000000000000
000000000000000000000000000000
000000000000000000000000000000
000000000000000000000000000000
000000000000000000000000000000 <--------------------------------------The end of the first file
THE WORD<-------------------------------------------------------------Split point
000000000000000000000000000000 <--------------------------------------The beginning of the second file
000000000000000000000000000000



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?

Viewing all articles
Browse latest Browse all 22109

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>