Can readtable read variable opt in a loop?

I have a lot of xlsm files to process.
Essentially I have a loop that searched for sheet name and column name that satisfies certain criteria and retrieve and store the sheet name and column, for example in a particular loop, perhaps,
SheetName = “1”; Col = “BH”;
Can I set these variable as options to readtable?

 采纳的回答

Yes.
'sheet' and 'range' are both valid for "spreadsheet" (.xls, .xlsx) files

3 个评论

What about xlsm files? Also do you have an example?
Yes xlsm too.
Sheetname="1"; Col="BH" ;
readtable('YourFile.xlsm','sheet',Sheetname,'range',Col)
Thank you! For col I used BH:BH

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Environment and Settings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by