Effacer les filtres
Effacer les filtres

Can readtable read variable opt in a loop?

4 vues (au cours des 30 derniers jours)
chlor thanks
chlor thanks le 31 Mar 2020
Commenté : chlor thanks le 7 Avr 2020
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?

Réponse acceptée

Walter Roberson
Walter Roberson le 31 Mar 2020
Yes.
'sheet' and 'range' are both valid for "spreadsheet" (.xls, .xlsx) files
  3 commentaires
Walter Roberson
Walter Roberson le 31 Mar 2020
Yes xlsm too.
Sheetname="1"; Col="BH" ;
readtable('YourFile.xlsm','sheet',Sheetname,'range',Col)
chlor thanks
chlor thanks le 7 Avr 2020
Thank you! For col I used BH:BH

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by