public class TabularFiles extends Object
TabularDataFileReader
instances.Constructor and Description |
---|
TabularFiles() |
Modifier and Type | Method and Description |
---|---|
static TabularDataFileReader<List<String>> |
newTabularFileReader(Reader reader,
char delimiterChar,
boolean headerLine)
Get a new TabularDataFileReader using default quote char (") and default endOfLineSymbols (\n).
|
static TabularDataFileReader<List<String>> |
newTabularFileReader(Reader reader,
char delimiterChar,
String endOfLineSymbols,
Character quoteChar,
boolean headerLine)
Get a new TabularDataFileReader.
|
static TabularDataFileReader<List<String>> |
newTabularFileReader(Reader reader,
char delimiterChar,
String endOfLineSymbols,
Character quoteChar,
boolean headerLine,
Integer lineToSkipBeforeHeader)
Get a new TabularDataFileReader.
|
public TabularFiles()
public static TabularDataFileReader<List<String>> newTabularFileReader(Reader reader, char delimiterChar, String endOfLineSymbols, Character quoteChar, boolean headerLine) throws IOException
reader
- delimiterChar
- endOfLineSymbols
- quoteChar
- nullableheaderLine
- IOException
public static TabularDataFileReader<List<String>> newTabularFileReader(Reader reader, char delimiterChar, String endOfLineSymbols, Character quoteChar, boolean headerLine, Integer lineToSkipBeforeHeader) throws IOException
reader
- delimiterChar
- endOfLineSymbols
- quoteChar
- NullableheaderLine
- do we expect the first line before the data to be a header linelineToSkipBeforeHeader
- Nullable. How many line(s) is required to skip in the file before reading the header or the data.
This can be used to skip a comment block but if there is a header line, the comment block shall be before the header.IOException
public static TabularDataFileReader<List<String>> newTabularFileReader(Reader reader, char delimiterChar, boolean headerLine) throws IOException
try (TabularDataFileReader<List<String>> reader = TabularFiles.newTabularFileReader(
Files.newBufferedReader(Paths.get("/tmp/test.csv"), StandardCharsets.UTF_8), ',', true)) {
...
}
reader
- delimiterChar
- headerLine
- IOException
Copyright © 2024 Global Biodiversity Information Facility (GBIF). All rights reserved.