%Check data transfer from acquisition computer DAS03 to processing computer
%DAS04.

clear dirdas04 dirdas03 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 
    dirdas03=dir(['\\Ps3das03\d\Data\*0' yyyy(3:4), sprintf('%03i',ddd) '*.txt']); %the acquisition side
    dirdas04=dir(['D:\Data\' yyyy(3:4) sprintf('%03i',ddd)]); %processing side
    if ~isempty(dirdas03) && ~isempty(dirdas04)
        ii=find(~ismember(char(dirdas03(:).name),char(dirdas04(:).name),'rows'));  %find files which are not in both sides (does not check time, might consider it later)
        for ll=1:length(ii)
            copyfile(['\\Ps3das03\d\Data\' dirdas03(ii(ll)).name],['D:\Data\' yyyy(3:4) sprintf('%03i',ddd) '\' dirdas03(ii(ll)).name]);
        end;
    end;
catch
    return
end