save single video in single folder.. having 200 videos in a folder
1 回表示 (過去 30 日間)
古いコメントを表示
hello all, i have 200 videos in a folder.. i want to send one video to one new folder..
means want to get 200 new folders with different names which having single video in each..
required code
thanks
0 件のコメント
回答 (1 件)
Ameer Hamza
2020 年 3 月 20 日
編集済み: Ameer Hamza
2020 年 3 月 20 日
This code will work for all the video files with extension .mp4. If the extension is something else, then change the first line.
files = dir('*.mp4');
for i=1:numel(files)
current_path = fullfile(files(i).folder, files(i).name);
new_folder = fullfile(files(i).folder, files(i).name(1:end-4));
new_path = fullfile(files(i).folder, files(i).name(1:end-4), files(i).name);
mkdir(new_folder);
movefile(current_path, new_path, 'f')
end
10 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!