save single video in single folder.. having 200 videos in a folder
Ältere Kommentare anzeigen
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
Antworten (1)
Ameer Hamza
am 20 Mär. 2020
Bearbeitet: Ameer Hamza
am 20 Mär. 2020
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 Kommentare
Irfan Hussain
am 21 Mär. 2020
Ameer Hamza
am 21 Mär. 2020
Glad to be of help.
Irfan Hussain
am 21 Mär. 2020
Ameer Hamza
am 21 Mär. 2020
Does all the video files in each folder have same name?
Irfan Hussain
am 21 Mär. 2020
Ameer Hamza
am 21 Mär. 2020
Gives structure of five folders. How do you decide which 5 video files should go in one folder.
Irfan Hussain
am 21 Mär. 2020
Irfan Hussain
am 21 Mär. 2020
Irfan Hussain
am 21 Mär. 2020
Bearbeitet: Irfan Hussain
am 21 Mär. 2020
Irfan Hussain
am 25 Mär. 2020
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


