I am having trouble reading in a large text file (greater than 200,000 lines). I am using low-level file IO via the fgetl() function. The read loop just goes away and does not finish after hours.
In order to speed up the reading, I attempted to preallocate a character array into which I read the lines of the file. I know something about the width of the lines in the file and basically allocate more space than I'll need. Based on the fact that I already know the width and using the file size of the file, I attempt to get the number of lines present in the file.
With the pre-allocation change it still ran for a long time and made MATLAB hang.
Best Answer