Wildcard file name matching with multiple dots on Windows

조회 수: 4 (최근 30일)
Nicolas Bourbaki
Nicolas Bourbaki 2022년 6월 3일
답변: Jan 2022년 6월 3일
fclose(fopen('myfile.txt', 'w'));
fclose(fopen('myfile.txt.1', 'w'));
dir('*.txt.*')
will match "myfile.txt" and "myfile.txt.1" on Windows to my surprise.
Is there a way to only get 'myfile.txt.1'?
There is a similar post on
but this didn't help me

답변 (1개)

Jan
Jan 2022년 6월 3일
List = dir('*.txt.*')
List = List(contains({List.name}, '.txt.'))

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by