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?

 Respuesta aceptada

Walter Roberson
Walter Roberson el 31 de Mzo. de 2020

0 votos

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

3 comentarios

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Environment and Settings en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 31 de Mzo. de 2020

Comentada:

el 7 de Abr. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by