public class SpreadSheetReader extends Object implements DataSetSource<DataTable>
DataTable
.
The DataTable is automatically updated when the file changes.
Currently Excel (xlsx) and CSV-like files are supported.
TODO Currently columns in the sheet are read as DataSeries. Add support for row-based format.Modifier and Type | Class and Description |
---|---|
static class |
SpreadSheetReader.Config
Defines the configuration for a SpreadSheetReader.
|
Constructor and Description |
---|
SpreadSheetReader(File file)
Load data from the specified file.
|
SpreadSheetReader(File file,
int sheet,
int headerRow,
int firstDataRow,
int firstDataColumn)
Deprecated.
As of 2.0. Superseded by
SpreadSheetReader(hivis.data.reader.SpreadSheetReader.Config) . This constructor will be removed in future releases. |
SpreadSheetReader(File file,
int sheet,
int headerRow,
int firstDataRow,
int firstDataColumn,
boolean doublePrecision)
Deprecated.
As of 2.0. Superseded by
SpreadSheetReader(hivis.data.reader.SpreadSheetReader.Config) . This constructor will be removed in future releases. |
SpreadSheetReader(SpreadSheetReader.Config config)
Load data from a file using the given configuration.
|
public SpreadSheetReader(File file)
Load data from the specified file.
If the first row contains all strings, except one column at most, then it is used as the header row.
The generated DataTable will be updated in real time as changes are saved to the file.
DataSeries are created to match the data type for a column (using the first non-empty data element of a column):
file
- The spreadsheet file.public SpreadSheetReader(File file, int sheet, int headerRow, int firstDataRow, int firstDataColumn)
SpreadSheetReader(hivis.data.reader.SpreadSheetReader.Config)
. This constructor will be removed in future releases.file
- The spreadsheet file.sheet
- The zero-based index of the sheet in the spreadsheet to read from (if applicable).headerRow
- The zero-based index of the row to use as column headers, or -1 for no header row.firstDataRow
- The zero-based index of the row to start reading data from (to the end of the sheet).firstDataColumn
- The zero-based index of the column to start creating series from (up to the last column).public SpreadSheetReader(File file, int sheet, int headerRow, int firstDataRow, int firstDataColumn, boolean doublePrecision)
SpreadSheetReader(hivis.data.reader.SpreadSheetReader.Config)
. This constructor will be removed in future releases.file
- The spreadsheet file.sheet
- The zero-based index of the sheet in the spreadsheet to read from (if applicable).headerRow
- The zero-based index of the row to use as column headers, or -1 for no header row.firstDataRow
- The zero-based index of the row to start reading data from (to the end of the sheet).firstDataColumn
- The zero-based index of the column to start creating series from (up to the last column).doublePrecision
- If true then numeric series will be created as DataSeries<Double>, otherwise they will be created as DataSeries<Float>.public SpreadSheetReader(SpreadSheetReader.Config config)
Load data from a file using the given configuration.
The generated DataTable will be updated in real time as changes are saved to the file.
DataSeries are created to match the data type for a column (using the first non-empty data element of a column):
SpreadSheetReader.Config.doublePrecision(boolean)
.SpreadSheetReader.Config.useDeprecatedDates(boolean)
).config
- The configuration describing how to read and process the spreadsheet.public DataTable getData()
getData
in interface DataSetSource<DataTable>
Processing Library HiVis by Philip Poronnik, Oliver Bown, Oliver Coleman, Phillip Gough, Narayan Sankaran. (c) 2016-2017