Hello,
I have a folder ('preprocessed') containing about 200 .mat files . Each file is named '[name]_preprocessed.mat' . Here are examples of file names:
34_preprocessed.mat777_preprocessed.mat898_preprocessed.matHH55_preprocessed.mat
I have a .csv file that contains the [name] of some of these files (i.e. 34; 898).
I would like to move the files whose names are contained in the .csv document to a different folder (the 'test' folder).
Here is what I have for now (I have manually imported the .csv file called "listcsv"):
basepath=['./preprocessed/']files=dir([basepath '*.mat']);NS=length(files);mydir=['./test/']for s=1:NS if (strcmp(files(s).name(1),'string found in spreadsheet')) %I think this is where I need help
movefile basepath mydir endend
Any help would be greatly appreciated!!
Best Answer