Wildcard file name matching with multiple dots on Windows

8 Ansichten (letzte 30 Tage)
Nicolas Bourbaki
Nicolas Bourbaki am 3 Jun. 2022
Beantwortet: Jan am 3 Jun. 2022
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

Antworten (1)

Jan
Jan am 3 Jun. 2022
List = dir('*.txt.*')
List = List(contains({List.name}, '.txt.'))

Kategorien

Mehr zu File Operations finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by