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
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
Writes the aggration results