Specify format when using readtable() to read spreadsheet .xlsx?
Show older comments
Suppose my spreadsheet data.xlsx has a column of strings:
'abc', 'def', 'ghi'
Calling
myTable = readtable(data.xlsx)
puts each string into a cell array, like so:
{'abc'}, {'def'}, {'ghi'}.
The data cannot be accessed in the usual way, eg,
rows = myTable.Var1 == 'abc'
What I would like is each entry to be a string, without the cell-array wrapper. When I use the 'Format' option:
readtable(data.xlsx,'Format','%s'),
I get an error message:
Error using readtable (line 143).
Invalid parameter name: Format.
so it seems that the 'Format' option is not available for spreadsheets. Is this the case, or am I doing something wrong?
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!