I have a .txt file with 3235K number of lines, and 25 space delimited columns. I use the following code to read the file:
fread = fopen('data.txt', 'r');formatSpec ='%f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f';C = textscan(fread, formatSpec);A = [C{:}];fclose(fread)
My problem is, it only reads up to 249K lines. A is 249000×25 double.
This is the output when I typed 'memory':
Maximum possible array: 55317 MB (5.800e+10 bytes) *Memory available for all arrays: 55317 MB (5.800e+10 bytes) *Memory used by MATLAB: 859 MB (9.002e+08 bytes)Physical Memory (RAM): 8101 MB (8.494e+09 bytes)
Is there any way I can read the whole file?
Best Answer