필터 지우기
필터 지우기

how delete .txt in file extension with uigetdir comand

조회 수: 3 (최근 30일)
Luca Re
Luca Re 2023년 5월 20일
답변: Edoardo Mattia Piccio 2023년 5월 25일
selpath = uigetdir('C:\rova\','Seleziona cartella da caricare')
filelist = dir(strcat(selpath,"\*.txt"));
file = {filelist.name};
file(1)
ans =
1×1 cell array
{'prova.txt'}
i want to catch only name
now i try it:
file1=string(file);
ewStr = erase(file1,".txt")
now i solve it
or is there a better method?

답변 (1개)

Edoardo Mattia Piccio
Edoardo Mattia Piccio 2023년 5월 25일

Community Treasure Hunt

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

Start Hunting!