readtable problem: import a large .xls file. (the excel Row vule is more than IV)
1 view (last 30 days)
Show older comments
I have some .xls files, need to import, but the excel Row vule is more than IV.
How can I solve the problem? readtable not works.
2 Comments
Walter Roberson
on 11 Oct 2022
I do not understand? Excel numbers rows, not names them.
What is the number of rows and columns in the file?
dpb
on 11 Oct 2022
Going to have to do more than that to show it's readtable with a problem....
x=(1:256);
writematrix(x,'text.xlsx')
tX=readtable('test.xlsx');
produced
>> whos x
Name Size Bytes Class Attributes
x 1x256 2048 double
>> tX(:,[1:5 end-5:end])
ans =
1×11 table
Var1 Var2 Var3 Var4 Var5 Var251 Var252 Var253 Var254 Var255 Var256
____ ____ ____ ____ ____ ______ ______ ______ ______ ______ ______
1 2 3 4 5 251 252 253 254 255 256
>>
so that number of columns isn't inherently an issue.
Attach the spreadsheet or at least post the code and error in context...
Answers (1)
Rahul
on 14 Oct 2022
In general, the amount of data that can be loaded into memory depends on your machine's RAM.
To workaround the memory limitation, MATLAB has a feature called 'datastore'. This feature allows you to read and process your data without loading everything into memory at once.
You can refer to the "tabularTextDatastore" to learn more about 'datastore' for CSV file:
You can also refer to the following documentation for a more general overview about our 'datastore' feature:
Additionally, if your workflow also demands manipulating the data as array after you import them as 'datastore', you can leverage another feature called Tall array:
0 Comments
See Also
Categories
Find more on Data Import from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!