public void print(Object value) {
      if (csvPrinter == null) {
        try {
          csvPrinter = csvFormat.print(new PrintWriter(filePath));
        } catch (IOException e) {
          ioTPrinter.printException(e);
          return;
        }
      }
      try {
        csvPrinter.print(value);
      } catch (IOException e) {
        ioTPrinter.printException(e);
      }
    }
write data to CSV file.

@param headerNames the header names of CSV file
@param records the records of CSV file
@param filePath the directory to save the file
iotdb-client/cli/src/main/java/org/apache/iotdb/tool/data/AbstractDataTool.java