code: def write_result
        sum_line = [sum_row_title]
        (heading.size - 2).times { sum_line << "" }
        sum_line << sums[sum_col_title]
        row = 0;
        File.open(outfile, 'w') do |out|
          out.puts sum_line.join(';') if row == sum_row ; row += 1
          out.puts heading.join(';')
          key_values.each do |k, v|
            out.puts sum_line.join(';') if row == sum_row ; row += 1
            out.puts [k, v].join(';')
          end
        end
      end
docs: Writes the aggration results