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.

Export behavior notes:

  • Datasets that contain no points are omitted from the CSV header and data columns so spreadsheets do not receive empty/unused columns.
  • Values are matched by X using a small tolerance; missing cells are left blank.
  • 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. Datasets with no points are omitted from the CSV to avoid empty columns. Missing values are left blank.
      Parameters:
      filePath - the path where the CSV file will be written
      datasets - the datasets to export (the exporter filters out empty series)
      Throws:
      IOException - if writing to the file fails