Use UIGETFILE for a file without an extension.

조회 수: 5 (최근 30일)
Steve K
Steve K 2023년 3월 22일
댓글: Steve K 2023년 3월 22일
I have a file that has a period in the filename but no extension on the end. I know these files are CSV/DAT files and if I manually add the extension I can read it just fine. However I am using the uigetfile function in app designer and it throws an error that it doesn't recognize the extension if I select one of these files. My files come from another tool where I can't control the format in which they are provided.
Example filename: "230322.testfile"
Ultimately I want to write the file to a table in my app so I can do further processing of the data.
  댓글 수: 2
Kevin Holly
Kevin Holly 2023년 3월 22일
You shouldn't be getting an error using uigetfile alone as the outputs of this function is the file name and folder. Are you trying to import the file immediately afterwards and then getting an error? What error are you getting?
Steve K
Steve K 2023년 3월 22일
I apologize. You are correct. I was getting my error on the line after, where I wanted to read it in with readtable. I ended up finding the "FileType" option of the function and forcing it to "text" and it read just fine.
Thanks

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by