public class CsvImporter extends DelimitedLineImporter
An Importer that can handle generic CSV files that have header
information in the first line. It is advisable to extend this class for CSV
data that has special requirements. This class makes some general assumptions
that can be configured in a subclass:
It is assumed that the first line of a CSV file contains the header. If that
is not the case, the subclass can return an ordered array of header keys from
the DelimitedLineImporter.header() method.
It is assumed that values in a line are comma separated. If that is not the
case, the subclass can specify a different rule in the delimiter()
method.
It is assumed that the original file data is correct. If that is not the
case, the subclass can selectively transform some values in the
#transformValue(String, String) method. For example, it might be
desirable specify link resolution, compact data or normalize data.
ANNOTATE_DATA_SOURCE_OPTION_NAME, concourse, DATA_SOURCE_ANNOTATION_KEY, params| Constructor and Description |
|---|
CsvImporter(Concourse concourse)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected char |
delimiter()
The delimiter that is used to split field on each line.
|
header, importFile, importFile, importString, importString, parseHeader, transformerpublic CsvImporter(Concourse concourse)
concourse - protected char delimiter()
DelimitedLineImporterdelimiter in class DelimitedLineImporter