Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Copying script
%% Copy post-clustered data in the old raw data folder to the new raw data folder
basepath = 'D:\Lobster\GR\GR7_NeuroNexus16_v1-180607-151420\GR7';
basepath2 = 'C:\VCF\Lobster\data\rawdata';
filelist = dir(basepath);
workingfile = regexp({filelist.name},'#\S*','match');
workingfile = workingfile(~cellfun('isempty',workingfile));
for f = 1 : numel(workingfile)
currentfile = cell2mat(workingfile{f});
date = regexp(currentfile,'-\d{6}-','match');
date = date{1}(4:end-1);
plxfilename = dir(strcat(basepath2,filesep,date,filesep,'*.plx'));
plxfilename = plxfilename.name;
txtfilename = dir(strcat(basepath2,filesep,date,filesep,'*.txt'));
txtfilename = txtfilename.name;
mkdir(strcat(basepath, filesep, currentfile, filesep, 'recording'));
copyfile(strcat(basepath2,filesep,date,filesep,plxfilename),...
strcat(basepath,filesep,currentfile,filesep,'recording',filesep,plxfilename));
copyfile(strcat(basepath2,filesep,date,filesep,txtfilename),...
strcat(basepath,filesep,currentfile,filesep,'recording',filesep,txtfilename));
fprintf('%2d : %s copyed.\n',f,currentfile);
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment