wildcard in filename for readtable does not work
이전 댓글 표시
When trying to load the table in matlabwith table = readtable("...\SP17\2022SP17.xlsx"), I can get the file loaded, but when I try to do it with a wildcard: table = readtable("...\SP17\2022*.xlsx") (or another variation with an asterix) it gives the error:
Error using readtable
Unable to find or open '...\SP17\2022*.xlsx'. Check the path and filename or file permissions.
I need to use the wildcard later as I don't know the full name of the files, I need to use.
댓글 수: 1
"when I try to do it with a wildcard: table = readtable("...\SP17\2022*.xlsx") "
Can you point to the exact location in the READTABLE documentation where it states that the filename can include wildcard characters?
"I need to use the wildcard later as I don't know the full name of the files"
Use DIR:
채택된 답변
추가 답변 (1개)
Les Beckham
2023년 11월 20일
0 개 추천
댓글 수: 1
Cris LaPierre
2023년 11월 20일
The problem with a wildcard is that there is no guarantee it returns a single file. You could use wildcards to collect file names using the dir function or datastores, and then use the result of that to load files.
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!