I have a huge text file (1 GB), where each "line" is separated by ##.
For example:
## sentence 1 ## sentence 2
## sentence 3
I'm trying to print the file according to the ## separation.
I tried the following code, but the read() function crush (because the size of the file).
import re
dataFile = open('post.txt', 'r')
p = re.compile('##(.+)')
iterator = p.finditer(dataFile.read())
for match in iterator:
print (match.group())
dataFile.close()
Any ideas?