% Make block file names match the block directory name

tank = 'C:\Users\jon\Documents\2013_Optoclamp-Analysis\2013_12_In-Vivo_Optoclamp\2014_04_15_A\';
fids = dir([tank '\R*']);

for i = 4:length(fids)
    
    fid = fids(i).name;
    files = dir([tank '\' fid '\Data*']);
    
    for j = 1:length(files)
        if ~strcmp(files(j).name,['2014_04_15_A_' fid files(j).name(end-3:end)])
            movefile([tank '\' fid '\' files(j).name], [tank '\' fid '\2014_04_15_A_' fid files(j).name(end-3:end)],'f')
        end
    end
end