Wildcard file name matching with multiple dots on Windows

9 ビュー (過去 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 Center および File ExchangeFile Operations についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by