Filter löschen
Filter löschen

loading all files from a user specified folder into a gui

2 Ansichten (letzte 30 Tage)
Stephen Devlin
Stephen Devlin am 19 Jan. 2018
Kommentiert: Adam am 19 Jan. 2018
Hi,
Is there a way for a GUI to allow a user to select a folder of text files on their own computer and have the GUI work on all the txt files within that folder?
Best regards
Steve

Akzeptierte Antwort

Mahesh
Mahesh am 19 Jan. 2018
x = uigetfile({'*.txt'});
fid = fopen(x);

Weitere Antworten (1)

Matt J
Matt J am 19 Jan. 2018
Bearbeitet: Matt J am 19 Jan. 2018
  1 Kommentar
Adam
Adam am 19 Jan. 2018
Combined with something like:
info = dir( folder );
filenames = { info.name };
[~,~,ext] = cellfun( @fileparts, filenames , 'UniformOutput', false )
txtIdx = strcmp( ext, { '.txt' } )
filenames = filenames( txtIdx )
to give you all the filenames of the desired type from the directory.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by