I have a 5gb text file and i am trying to read it line by line. My file is in format-: Reviewerid<\t>pid<\t>date<\t>title<\t>body<\n> This is my code
o = open('mproducts.txt','w')
with open('reviewsNew.txt','rb') as f1:
for line in f1:
line = line.strip()
line2 = line.split('\t')
o.write(str(line))
o.write("\n")
But i get Memory error when i try to run it. I have an 8gb ram and 1Tb space then why am i getting this error? I tried to read it in blocks but then also i get that error.
MemoryError