Why can't I import the following file using the following command?

5 views (last 30 days)
When I type:
>> b = readtable('24198 1A 1.tif_8.csv');
I have no errors and the table is imported nicely.
When I type:
>> b = readtable('24198 1A 1.tif_9.csv');
I get:
Error using textscan Out of memory. Type HELP MEMORY for your options.
Error in table/readTextFile (line 160) raw = textscan(fid,format,'delimiter',delimiter,'whitespace',whiteSpace, ...
Error in table.readFromFile (line 41) t = table.readTextFile(filename,otherArgs);
Error in readtable (line 114) t = table.readFromFile(filename,varargin);
I can't seem to understand why this happens. I have tens of these cdv files and all import fine except for 24198 1A 1.tif_9.csv.
Why?

Answers (2)

Star Strider
Star Strider on 9 Jan 2015
I can’t reproduce the error with:
b = readtable('24198 1A 1.tif_9.csv');
It imports and creates the table without problems in R2014b.
It’s an Excel-formatted file, so see if:
[d,s,r] = xlsread('24198 1A 1.tif_9.csv');
works for you.
  2 Comments
Dale
Dale on 9 Jan 2015
This gives error:
>> [d,s,r] = xlsread('24198 1A 1.tif_9.csv');
Error using xlsread (line 248) Unable to read XLS file /24198 1A 1.tif_9.csv. File is not in recognized format.
Also, I am using R2013b. Could this be a problem?
Star Strider
Star Strider on 9 Jan 2015
It could be. I don’t imagine there would be significant version differences, but there could be.
Can you open it in Excel (outside of MATLAB) by clicking on it?
I’m out of ideas otherwise, since I can’t reproduce the problem.

Sign in to comment.


Image Analyst
Image Analyst on 9 Jan 2015
You're missing a column header for the first column. Try this to ignore that.
t = readtable('24198 1A 1.tif_9.csv', 'readRowNames', true);
  2 Comments
Dale
Dale on 9 Jan 2015
Still the same error:
>> b = readtable('24198 1A 1.tif_9.csv', 'readRowNames', true); Error using textscan Out of memory. Type HELP MEMORY for your options.
Error in table/readTextFile (line 160) raw = textscan(fid,format,'delimiter',delimiter,'whitespace',whiteSpace, ...
Error in table.readFromFile (line 41) t = table.readTextFile(filename,otherArgs);
Error in readtable (line 114) t = table.readFromFile(filename,varargin);
Image Analyst
Image Analyst on 10 Jan 2015
I tried it again with my lowly 8 GB RAM memory, i5-CPU computer and it ran fine and loaded a 45x45 table. Are you sure you gave us the full file and not a smaller subset?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!