Sorting file (from a text file) and copying file to the new folder
1 回表示 (過去 30 日間)
古いコメントを表示
Dear MATLAB experts
I want to sort the content of file based on the text file (e.g. *.txt) and then copy all the list files into another directory.
Source: C:\ sub001 (a list of subjects on the text file) ○ A ■ Sub-directory ○ B ■ Sub-directory
Text file: sub001 , sub002 and etc.
Destination: D:\Sorter
--
Thanks for considering my questions.
Best wishes
Larry Lai
2 件のコメント
Paolo
2018 年 7 月 12 日
So you want to open text files, read their contents and move said files to a different destination according to the contents?
What do the text files look like?
回答 (1 件)
Paolo
2018 年 7 月 12 日
If I am understanding the question correctly the following should help you:
fid = fopen('SubjectsID.txt')
while ~feof(fid)
tline = fgetl(fid);
name = strcat(tline,'.txt');
movefile(name,'D:\Sorter')
end
3 件のコメント
参考
カテゴリ
Help Center および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!