how to check whether a sheet exists or not, while using readtable function
조회 수: 25 (최근 30일)
이전 댓글 표시
rawData = readtable('filepath.xls','Sheet','Data Export')
in the above command, if sheet is not available then its throwing an error.
Error using readtable (line 216)
Sheet name 'Data Export' does not exist or is not supported. To check if the sheet is supported, specify the sheet by its worksheet index.
So i would like to skip this error and proceed further without using 'xlsfinfo'. if possible help me out please.
댓글 수: 0
답변 (1개)
Jeremy Hughes
2020년 3월 3일
I don't know if it's any better, but there is https://www.mathworks.com/help/matlab/ref/sheetnames.html
Otherwise, try/catch might work.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!