Open output file for update. for each input file open current input file for input read header if (first input) {ouput header} read body output body close input file close output file