% Humboldt University Berlin
% Institute for Mathematics - Dr. Rene Lamour
% *************************************************************************
% Name:             filappend.m
%                   -----------
% Author:           Sigrid Wehner
% Stand:            3.7.2003 
%
% Purpose:          appends text file "filename2"
%                   to existing text file "filename1"
%                   result is in "filename1"
% Parameters:       fione - name of first source file
%                           which will contain the result
%                   fitwo - name of second file which will be
%                           appended to fione
% ----------------------------------------------------------------------

function [] = filappend(fione,fitwo)

% open first file (which will contain the result) and switch to new line
fid = fopen(fione,'a');
fprintf(fid,'\n');

% open second file which is to be appended
fidapp = fopen(fitwo,'rt');

while feof(fidapp) == 0
    tline=fgetl(fidapp);
    fprintf(fid,'%s \n ',tline);
end;

fclose(fid);
fclose(fidapp);