emptylines=10;

fnames = dir('*.enw'); %Pozor, musí být aspoň 2 soubory!
numfids = length(fnames);


outFid=fopen('merged.enw','wt');
fopen(outFid);


for K = 1:numfids
    fid=fopen(fnames(K).name);
    fopen(fid);
    text=textscan(fid,'%s','delimiter','\n');
    text=text{1};
    if(~isempty(text))
        fclose(fid);
        for j=1:length(text)
            fprintf(outFid, '%s\n', text{j});
        end

        for k=1:emptylines
            fprintf(outFid, '%s\n', '');
        end
    end
end

fclose(outFid);