I have a 30gb txt file and i want to filter some data:
output = open ('output.txt', 'a')
with open ('30gbfile.txt') as f:
for line in f:
if 'xxx' in line:
output.write(line)
output.close()
No error occurs, but the execution stops after few seconds and output.txt contains only the 3% of data that had to be extracted.