Why is "readtable" taking dimensions from first sheet in excel when using "opts"?
Show older comments
Why is "readtable" using the dimensions of the first sheet in excel when I trying to get data from another sheet?
For example, if the first sheet has 10 rows and 3 columns, second sheet has 15 rows and 7 columns. When I use "readtable" and use "opts" to read all the data from second sheet in "char" format, the output has only 10 rows and 3 columns of the data from second sheet.
Why does this not happen when I don't use "opts" to set import options?
Here is an example code:
eqdFile = 'JUNK2.xlsx';
opts = detectImportOptions(eqdFile);
opts = setvartype(opts,'char');
T = readtable(eqdFile,opts,'Sheet','NameOfSheet')
Accepted Answer
More Answers (0)
Categories
Find more on Spreadsheets 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!