I have a source folder called "data". There are 29 subfolders in the source folder with each person's name on it. And, also there is two more subfolders. Under one of this subfolders corresponding to each name of the folder, there is a target file which is .csv format. For example, "data/001_Jake,..,029_Maria/001_Jake_subfolder/target_file.csv"
What I want to do is to move that all target files from the subfolders to new directory using loop.
Please help me out. Thank you.
I made for loop to move all files into new directory, but I have no idea of selecting .csv format files from subfolder.
sourcePath = '/Volumes/data' fileList = dir(sourcePath);
fileList = fileList(~ismember({fileList.name},{'.','..','}));
dirFolder = "/Users/newDirectory/"
for i:length(fileList)
movefile(fullfile(fileList(i).name, ))