Package com.digitizer.io
Class CsvExporter
java.lang.Object
com.digitizer.io.CsvExporter
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 Summary
Modifier and TypeMethodDescriptionstatic voidexportToCsv(String filePath, List<Dataset> datasets) Exports datasets to a CSV file in wide format.
-
Method Details
-
exportToCsv
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 writtendatasets- the datasets to export (the exporter filters out empty series)- Throws:
IOException- if writing to the file fails
-