Create folders and organize data based on file name.

4 ビュー (過去 30 日間)
Tyler
Tyler 2023 年 1 月 20 日
回答済み: Stephen23 2023 年 1 月 20 日
The current code makes .txt files from the raw data file type. This then is plotted later (that is all figured out). However, to make the code more helpful, can I have it organize the data into folders based differences in the file name?
For example, the picture below has raw data from two different testing locations (CP-A-01 and CP-B-01). Can these files be sorted based on that difference in the file name?

回答 (2 件)

Jon
Jon 2023 年 1 月 20 日
You should be able to select the ones you want using dir and wildcards so for example
list = dir('*CP-B-01*.txt')

Stephen23
Stephen23 2023 年 1 月 20 日
movefile('*CP-A-01*.*', 'newdir01')
movefile('*CP-B-01*.*', 'newdir02')

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by