function[newfiles]=get_etl_files(etldir)
newfiles=0;
dbg=1;
% now set in set_up as etldir
%DATADIR = '\\Ps3das01\SharedDocs';
% workgroup psd3, system ps3das02

% directories are YYDDD, e.g. 10003 for Jan 3 2010
dv=datevec(now);
my_year=dv(1) - 2000; yrstr=num2str(my_year);  %'11'

% see what's on the server:
edirs= dir([etldir '/' yrstr '*']);
numedirs=length(edirs);
% eg:   11087  11089  11088  11090
% check last 2 directories, and check file sizes
% or only copy 61-line files
for chk=(numedirs-1):numedirs
    thedir= edirs(chk).name;    % e.g.  11090
    me_filelist = dir ([ etldir '/'  thedir '/me1*.txt']);
    numetl=length(me_filelist);
    % see what we've got; filenames contain orig dir name
    myfilelist = dir(['data/etl/read/me10' thedir '*.txt' ]);
    %   me101109112_raw.txt
    numold=length(myfilelist);
    if numold < numetl,
        for iex=1:numetl
            cfile=[ etldir '/'  thedir '/' me_filelist(iex).name ];
            if exist(['data/etl/read/' me_filelist(iex).name],'file') == 0 ...
               && exist(['data/etl/new/' me_filelist(iex).name],'file') == 0
                if dbg==1
                    disp(['will copyfile( ' cfile, ' to data/etl/new)']);
                end
                copyfile(cfile, 'data/etl/new');
                newfiles=newfiles + 1;
                cfile2=strrep(cfile,'me1','me2');
                % occasional error here:
                try
                copyfile(cfile2, 'data/etl/new');
                catch
                    disp('error, no me2file');
                end
            end
        end
    end
end
newfdir=dir('data/etl/new/me1*_raw.txt');
newfiles=length(newfdir);
fprintf('%d files to process\n', newfiles);



