%Check data transfer from acquisition computer DAS01 to processing computer
%DAS02.

clear dirdas02 dirdas01 dir
clear ii
%file format is aaabyyjjjhh_raw.txt, with aaa the instrument id and b an
%index (default is 0 for one instrument)
try 
    dirdas01=dir(['\\Ps3das01\d\Data\*' yyyy(3:4), sprintf('%03i',ddd) '*.txt']); %the acquisition side
    dirdas02=dir(['D:\Data\' yyyy(3:4) sprintf('%03i',ddd)]); %processing side
    if ~isempty(dirdas01) && ~isempty(dirdas02)
        ii=find(~ismember(char(dirdas01(:).name),char(dirdas02(:).name),'rows'));  %find files which are not in both sides (does not check time, might consider it later)
        for ll=1:length(ii)
            copyfile(['\\Ps3das01\d\Data\' dirdas01(ii(ll)).name],['D:\Data\' yyyy(3:4) sprintf('%03i',ddd) '\' dirdas01(ii(ll)).name]);
        end;
    end;
catch
    return
end