Contents

% boxy_rename.m - rename boxy files and stash in desired directories
% !!!!NOTE: Make sure that only data from 1 subject is in each folder with
% orig file names (i.e., time/date filenames)
% May 2013, Kyle Mathewson and Nils Schneider after Ed Maclin's Code

clear
close all
clc

Change these settings

data_path='c:\data\';
exp1='abc\';
subj='1234';

disp('Copying & renaming ABC files')
Copying & renaming ABC files

get lists of bh\ file names for 1 machine

list2L=dir([data_path exp1 'opt2\*.txt']);
if ~isempty(list2L)
    for i_file=1:length(list2L)
        s_file=sprintf('%03.0f',i_file);
        in_file=['opt2\' list2L(i_file).name];
        out_file=['opt\' 'rop' subj  '.' s_file];
        fprintf('Copying %s to %s\n',in_file,out_file)
        copyfile([data_path exp1 in_file],...
        [data_path exp1 out_file]);
    end
end

rename and copy set files

get lists of bh\ file names for 1 machine
disp('Copying & renaming ABC files')
list2L=dir([data_path exp1 'opt2\*.set']);
if ~isempty(list2L)
    for i_file=1:length(list2L)
        s_file=sprintf('%03.0f',i_file);
        in_file=['opt2\' list2L(i_file).name];
        out_file=['set\' 'rop' subj  '.' s_file];
        fprintf('Copying %s to %s\n',in_file,out_file)
        copyfile([data_path exp1 in_file],...
        [data_path exp1 out_file]);
    end
end
Copying & renaming ABC files