function ascii_wrapper (nc_directory, ascii_directory, mat_directory, ...
    all_dep_dir, all_filename, nc_filename)


for file = 1:length(nc_filename),
    [new_data, new_meta_data, header, append, data, meta_data, time_esecs] ...
        = nc_to_ascii (nc_directory, mat_directory, char(nc_filename(file)));
    if (isempty(new_data)==0),
        tblwrite_smb(new_data, header, new_meta_data, ...
            [ascii_directory char(nc_filename(file)) '.txt'],'\t',12, append)
        %also appends to entire data set...
        tblwrite_smb(new_data, header, new_meta_data, ...
            [all_dep_dir char(all_filename(file)) '.txt'],'\t',12, 1)
    
        save ([mat_directory char(nc_filename(file)) '.mat'], 'data', 'meta_data', 'header', 'time_esecs');

    end
end

end