public class CSVReaderFactory extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CSVReaderFactory.CSVMetadata
Data about the CSV file
|
Constructor and Description |
---|
CSVReaderFactory() |
Modifier and Type | Method and Description |
---|---|
static CSVReader |
build(File source)
Assumes 1 header row
|
static CSVReader |
build(File source,
Integer headerRows)
Build a CSVReader and try to detect the encoding, delimiter and quotes.
|
static CSVReader |
build(File source,
String delimiter,
boolean header)
Build a CSVReader with specific delimiter and presence or not of a header line.
|
static CSVReader |
build(File source,
String encoding,
String delimiter,
Character quotes,
Integer headerRows)
Build a CSVReader with specific encoding, delimiter, quotes character and number of header row(s).
|
static CSVReader |
build(File source,
String encoding,
String delimiter,
Integer headerRows)
Build a CSVReader with specific encoding, delimiter and number of header row(s) but default quote character
(quotation marks)
|
static CSVReader |
build(InputStream stream,
String encoding,
String delimiter,
Character quotes,
Integer headerRows)
Build a CSVReader with specific encoding, delimiter quotes and number of header row(s)
|
static CSVReader |
buildTabReader(InputStream stream,
String encoding,
Integer headerRows) |
static CSVReader |
buildUtf8TabReader(InputStream stream) |
static CSVReaderFactory.CSVMetadata |
extractCsvMetadata(File source,
String encoding)
Replaced by
TabularFileMetadataExtractor
Extract metadata from a CSV file. |
public CSVReaderFactory()
public static CSVReader build(File source, String delimiter, boolean header) throws IOException
source
- delimiter
- header
- Does the file include a header line ?IOException
public static CSVReader build(File source, String encoding, String delimiter, Character quotes, Integer headerRows) throws IOException
source
- encoding
- delimiter
- quotes
- headerRows
- IOException
public static CSVReader build(File source, String encoding, String delimiter, Integer headerRows) throws IOException
source
- encoding
- delimiter
- headerRows
- IOException
public static CSVReader build(InputStream stream, String encoding, String delimiter, Character quotes, Integer headerRows) throws IOException
stream
- encoding
- delimiter
- quotes
- headerRows
- IOException
public static CSVReader build(File source, Integer headerRows) throws IOException
source
- headerRows
- IOException
public static CSVReader build(File source) throws IOException
source
- IOException
public static CSVReader buildTabReader(InputStream stream, String encoding, Integer headerRows) throws IOException
IOException
public static CSVReader buildUtf8TabReader(InputStream stream) throws IOException
IOException
public static CSVReaderFactory.CSVMetadata extractCsvMetadata(File source, String encoding) throws UnknownDelimitersException
TabularFileMetadataExtractor
Extract metadata from a CSV file.
Metadata includes delimiter and quotes character.source
- encoding
- UnknownDelimitersException
Copyright © 2024 Global Biodiversity Information Facility (GBIF). All rights reserved.