Can readtable read variable opt in a loop?

조회 수: 1 (최근 30일)
chlor thanks
chlor thanks 2020년 3월 31일
댓글: chlor thanks 2020년 4월 7일
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?

채택된 답변

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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by