Created
December 24, 2020 07:59
-
-
Save knowblesse/a38987a82c68c616163554df9c9275a1 to your computer and use it in GitHub Desktop.
Copying script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% 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