code: public static void print(CSTable table, PrintWriter out) {
          out.println(TABLE + "," + CSVParser.printLine(table.getName()));
          for (String key : table.getInfo().keySet()) {
              out.println(CSVParser.printLine(key, table.getInfo().get(key)));
          }
          if (table.getColumnCount() < 1) {
              out.flush();
              return;
          }
          out.print(HEADER);
          for (int i = 1; i <= table.getColumnCount(); i++) {
              out.print("," + table.getColumnName(i));
          }
          out.println();
          Map<String, String> m = table.getColumnInfo(1);
          for (String key : m.keySet()) {
              out.print(key);
              for (int i = 1; i <= table.getColumnCount(); i++) {
                  out.print("," + table.getColumnInfo(i).get(key));
              }
              out.println();
          }
          for (String[] row : table.rows()) {
              for (int i = 1; i < row.length; i++) {
                  out.print("," + row[i]);
              }
              out.println();
          }
          out.println();
          out.flush();
      }
docs: Print a CSTable to a PrintWriter
  
  @param table the table to print
  @param out the writer to write to