Hi Benjamin,
you can pick up the filename with the specific day as the followings:
for i = 1:30 % from 1st to 30th
searchStr = sprintf('201909%02d*', i); % %02i means two digits integer with 0 padding
fileInfo = dir(searchStr);
fileInfo.name % just for cheking
targetFolder = sprintf('%d',i) % no padding
% movefile for each
filenames = cat(1, fileInfo.name);
for filei = 1:size(filenames,1)
filename = filenames(filei,:);
disp(filename) % just for cheking
if exist(targetFolder) == 7 % if the targetFolder is the existing folder
movefile(filename, targetFolder);
end
end
end
Perhaps, this codes will work well. But, just in case, please try without movefile at once in your environment.
Hope this helps.