public class ReadByLine extends Object implements AutoCloseable
Constructor and Description |
---|
ReadByLine(Path filePath,
CSVReader csvReader) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes any opened-files
|
String[] |
headers()
The headers of the CSV file.
|
int |
read(ProcessCSVLine lineProcessor)
Reads a CSV-file iterating through each row and passing it to lineProcessor
|
public String[] headers() throws CSVReaderException
CSVReaderException
- if the file cannot be opened successfully.public int read(ProcessCSVLine lineProcessor) throws CSVReaderException
This will automatically close any opened-files
lineProcessor
- called one for each row incrementallyCSVReaderException
- if any file-system I/O errors occur.public void close() throws CSVReaderException
close
in interface AutoCloseable
CSVReaderException
- if any file-system I/O errors occur.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.