function [H,H10,H20,H30,N,N10,N20,N30] = load_textdata(dir1,procin,nfin)

%procin = 'NOPROC';
%procin = 'proc.64';
%nfin   = '50000';
%dir1   = {'nomad.alone', 'dencon.alone', 'denpar.alone'};
%nfin   = '1000';
%dir1   = {'nomad.alone', 'nomad.dencon', 'nomad.denpar'};

ns = size(dir1,2);

%solver = {'nomad.nomad.', 'nomad.dencon.', 'nomad.denpar.'};
%solver = {'nomad.nomad.', 'nomad.nomad.dencon.', 'nomad.nomad.denpar.'};

for is = 1:ns,
    switch dir1{is}
        case 'nomad.alone', 
            nf{is} = '50000';
            solver{is} = 'nomad.nomad.';
        case 'dencon.alone',
            nf{is} = '50000';
            solver{is} = 'nomad.dencon.';
        case 'denpar.alone',
            nf{is} = '50000';
            solver{is} = 'nomad.denpar.';
        case 'nomad.dencon',
            nf{is} = nfin;
            solver{is} = 'nomad.nomad.dencon.';
        case  'nomad.denpar',
            nf{is} = nfin;
            solver{is} = 'nomad.nomad.denpar.';
        otherwise
            ;
    end
end

switch procin
    case 'NOPROC',
        extzip1 = '.NOPROC.50000.';
        processor = {'NOPROCFILE.'};
    case 'proc.64',
        extzip1 = '.proc.64.50000.';
        processor = {'list.processor.64.'};
    otherwise
        ;
end
extzip2 = '.n500.runmulticc.zip';
nproc = size(processor,2);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

problem = {'maxl.nf3', 'maxl.rg', 'maxl.sin', 'maxl.zkv', 'nf3.rg', 'nf3.sin', 'nf3.zkv', 'rg.sin', 'rg.zkv', 'sin.zkv'};
nprob = size(problem,2);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% RICORDATI DI CANCELLARE LA RIGA CHE SEGUE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%nprob = 1;

version = {'0', '1'};
nver = size(version,2);

nvariables = {'10', '20', '30'};
nvar = size(nvariables,2);

for iproc = 1,
    for is = 1:ns,
        nomealgo    = [solver{is} processor{iproc}];
        outdir      = ['/tmp/' solver{is} processor{iproc} '/'];
        nomefilezip = [dir1{is} extzip1 nf{is} extzip2];
        nomefile    = [outdir nomealgo 'result.zip'];
        mkdir(outdir);
        unzip(nomefilezip,outdir);
        unzip(nomefile,outdir);
        
        ip = 1;
        for iprob = 1:nprob,
            for iver = 1:nver,
                for ivar = 1:nvar,
                    nomehist = [problem{iprob} '_' version{iver} '_' nvariables{ivar} '.'];
                    nomecompleto = [outdir nomehist nomealgo 'result'];
                    temp = importdata(nomecompleto);
                    [rt,ct] = size(temp);
                    fprintf('%80s : %6d\n',[nomehist nomealgo 'result'],rt);
                    H(:,ip,is) = temp(:,1);
                    N(ip) = str2num(nvariables{ivar});
                    ip = ip+1;
                end
            end
        end
        
        %keyboard
        cmdsys = ['rm ' outdir '*'];
        system(cmdsys);
        cmdsys = ['rmdir ' outdir];
        system(cmdsys);        
    end
end

ind = find(N~=10);
N10 = N;
N10(ind) = [];
H10 = H;
H10(:,ind,:) = [];

ind = find(N~=20);
N20 = N;
N20(ind) = [];
H20 = H;
H20(:,ind,:) = [];

ind = find(N~=30);
N30 = N;
N30(ind) = [];
H30 = H;
H30(:,ind,:) = [];

end