How to filter out files with a list of specific string in UIGETFILE command?

조회 수: 5 (최근 30일)
Hi,
I need to filter the visible list of files containing multiple possible specific strings with UIGETFILE.
Example:
My folder contains following files:
  • EFI100.xls
  • EFA200.xls
  • EFA500.xls
  • EFB100.xls
  • etc.
I would like to see only EFA*.xls and EFB*.xls file in te selection list.
The command [xlsfile] = uigetfile('EFA*.xls','Select Excel file') works, ok.
But I want to list EFI*.xls too, I can I do?
Thanks.

채택된 답변

Jonas
Jonas 2022년 11월 28일
you can provide mutiple filters to choose from:
uigetfile({'EFA*.xls;EFB*.xls'},'Select a File');
this shows EFA*.xls files and EFB*.xls files
  댓글 수: 2
Gabriel Buche
Gabriel Buche 2022년 11월 28일
It works!
The problem is that I used this command: uigetfile({'EFA*.xls'; 'EFB*.xls'},'Select Excel file') with single quotation marks between EFA.xls and EFB.xls.
Thanks!

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

추가 답변 (1개)

Jan
Jan 2022년 11월 28일
편집: Jan 2022년 11월 28일
As far as I can see, the file pattern [x] is not implemented in uigetfile:
xlsfile = uigetfile('EF[AI]*.xls', 'Select Excel file') % Not working
I've tried this with R2018b only.

카테고리

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