Skip to content
Snippets Groups Projects
Commit dca7f66d authored by Adriaens, Ines's avatar Adriaens, Ines :v_tone2:
Browse files

system copy

parent 6ee40926
No related branches found
No related tags found
No related merge requests found
......@@ -19,9 +19,8 @@ clc
init_.inpdir = 'W:\ASG\WLR_Dataopslag\DWZ\1519\DC2019\liestand\ses2\';
% video path destination
init_.parentdir = ['W:\ASG\WLR_Genomica\Projects\Sustainable_breeding\' ...
init_.destdir = ['W:\ASG\WLR_Genomica\Projects\Sustainable_breeding\' ...
'44 0000 2700 KB DDHT AI 2020\6. Data\gu_ld_bb'];
init_.destdir = 'gu_ld_bb';
% number of selected videos
N = 15;
......@@ -34,7 +33,6 @@ vid_list.liedown = ls([init_.inpdir 'lied*']);
%% select videos and place them in new folder
% select N videos randomly from the list
idx = randi(size(vid_list.getup,1),N);
sel_list.getup = vid_list.getup(sort(randperm(size(vid_list.getup,1),N)),:);
sel_list.liedown = vid_list.liedown(sort(randperm(size(vid_list.getup,1),N)),:);
......@@ -44,14 +42,16 @@ if ~isfolder(init_.destdir) % folder doesn't exist - create
end
% delete all that are in
old_list = ls([init_.destdir '*.avi'])
if ~isempty(old_list)
delete('init_.destdir
delete('init_.destdir\*.avi')
% copy new selection in folder
for i = 1:N
system(['copy "' init_.inpdir sel_list.getup(i,:) '"' ...
' "' mapsucces meta.(fields_{1}).file{i} '"']);
copyfile([init_.inpdir sel_list.getup(i,:)], [init_.destdir '\'])
copyfile([init_.inpdir sel_list.liedown(i,:)], [init_.destdir '\'])
end
......
......@@ -46,10 +46,13 @@ delete('init_.destdir\*.avi')
% copy new selection in folder
for i = 1:N
copyfile([init_.inpdir sel_list.getup(i,:)], [init_.destdir '\'])
copyfile([init_.inpdir sel_list.liedown(i,:)], [init_.destdir '\'])
disp(['i = ' num2str(i) ' out of ' num2str(N)])
system(['copy "' init_.inpdir sel_list.getup(i,:) '"' ...
' "' [init_.destdir '\' sel_list.getup(i,:)] '"']);
system(['copy "' init_.inpdir sel_list.liedown(i,:) '"' ...
' "' [init_.destdir '\' sel_list.liedown(i,:)] '"']);
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment