file sorting into sub folder

Hello,inside my folder i have files in which the first the name before _0 or _1 represent the category. how could i recognize all the files of the same category and put them into their own a new sub folder.
Thanks

回答 (1 件)

Jos (10584)
Jos (10584) 2017 年 2 月 21 日

0 投票

Why use matlab for this? Just call the OS
mkdir('cat_1')
system('mv *_1.txt cat_1/.') % linux
dos('move *_1.txt cat_1\.;) % windows
but, you might take a look at movefile

カテゴリ

ヘルプ センター および File ExchangeFile Operations についてさらに検索

質問済み:

2017 年 2 月 21 日

回答済み:

2017 年 2 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by