Class CsvExporter

java.lang.Object
com.digitizer.io.CsvExporter

public class CsvExporter extends Object
Handles CSV export of graph digitizer datasets.

The CSV is written in "wide" format where the first column contains distinct X values (sorted) and each following column contains the corresponding Y value for a given dataset. The exporter collates values from multiple series and leaves empty cells when a dataset lacks a value for a particular X.

  • Method Details

    • exportToCsv

      public static void exportToCsv(String filePath, List<Dataset> datasets) throws IOException
      Exports datasets to a CSV file in wide format. The first column contains x values, followed by one column per dataset containing y values. Missing values are left blank.
      Parameters:
      filePath - the path where the CSV file will be written
      datasets - the datasets to export
      Throws:
      IOException - if writing to the file fails