-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeleteResults.m
37 lines (25 loc) · 898 Bytes
/
deleteResults.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
clearvars;
close all hidden;
dirpath=uigetdir('waehle den zu bearbeitenden Ordner aus');
cd(dirpath);
del_folder={'corrected' ;'cropped' ;'overlay'};
listofDirs=dir(dirpath);
j=1;
for ii = 1 : size(listofDirs,1)
if(listofDirs(ii).isdir && ~contains(listofDirs(ii).name,'.') && ~contains(listofDirs(ii).name ,'..'))
MainListofDirs(j) = listofDirs(ii); %#ok<SAGROW> % bei Bedarf vor allocaten, aber im Moment egal
j=j+1;
end
end
for d=1:length(MainListofDirs)
currentFolder=MainListofDirs(d);
cd(fullfile(currentFolder.folder,currentFolder.name));
delete *.pdf;
delete *.txt;
for ii=1:size(del_folder)
del_cell=fullfile(currentFolder.folder,currentFolder.name, del_folder(ii));
if(exist(del_cell{1},'dir'))
rmdir(del_cell{1},'s');
end
end
end