Im currently working on a program that uses a file having data in the format - 6 columns and dynamic no. of rows.
The file I got for testing is 26 mb and following is the program that converts first 3 columns into 3 different lists.
f = open('foo', 'r')
print('running...')
a = []
b = []
c = []
for line in f:
x = (line.split(' '))
a.append(x[0])
b.append(x[1])
c.append(x[2])
print(a,b,c,sep='\n')
I have rechecked this program and logic looks correct and when implemented on small file it works but when i use this program with the 26 mb file it stops responding.
Description of the program: The program opens a file name 'foo' and implements line by line of the file. It splits the line into parts based on the separator that is defined as an argument in the .split() method. In my program I have used white space as an separator as in the text file the data is separated using white spaces.
Im not able to figure out why this program stops responding and I need help with it!