[day, time, east, north, up, type, sat, ...
    p1, p2, p3, p4, p5, p6, p7, p8] = loadPosFile('../vstup/2018_24_G-tide.txt');

%  ATMOSPHERIC PRESSURE LOADING
fAtm = fopen('../vstup/2018_AtmDisplacement.txt');                                                                         
tAtm = textscan(fAtm, '%s %f %f %f','MultipleDelimsAsOne',1);          
fclose(fAtm);                                                                                          
atmU = tAtm{:,2};    
atmE = tAtm{:,3};     
atmN = tAtm{:,4};   

[eastAtm, northAtm, upAtm] = atmosphericLoadCor(east, north, up, atmE, atmN, atmU);
out = fopen('2018_24_G-atm.txt', 'w')
for i = 1 : length(day)
    if east(i) == NaN
        fprintf(out,'%s %s NaN NaN NaN %s %s %s %s %s %s %s %s %s %s\r\n', ...
            day{i},...
            time{i},...            
            east(i),...
            north(i),...
            up(i),...
            type{i}, ...
            sat{i},...
            p1{i}, ...
            p2{i}, ...
            p3{i}, ...
            p4{i}, ...
            p5{i}, ...
            p6{i}, ...
            p7{i}, ...
            p8{i});
        
    else    
        
  fprintf(out,'%s %s %0.4f %0.4f %0.4f %s %s %s %s %s %s %s %s %s %s\r\n', ...
            day{i},...
            time{i},...            
            eastAtm(i),...
            northAtm(i),...
            upAtm(i),...
            type{i}, ...
            sat{i},...
            p1{i}, ...
            p2{i}, ...
            p3{i}, ...
            p4{i}, ...
            p5{i}, ...
            p6{i}, ...
            p7{i}, ...
            p8{i});
    end
    
end

fclose(out);
disp('Hotovo!');