Package org.anchoranalysis.io.input.csv
Class CSVReader
Object
CSVReader
Reads a CSV File from the file-system.
- Author:
- Owen Feehan
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
A CSV file that has been opened for reading from the file-system. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOpens a CSV for reading.
-
Constructor Details
-
CSVReader
Create, expecting unquoted strings.- Parameters:
regularExpressionSeperator
- a regular-expression in Java syntax for splitting a line by separator.firstLineHeaders
- whether the first line of the CSV file contains headers or not.
-
CSVReader
public CSVReader(String regularExpressionSeperator, boolean firstLineHeaders, boolean quotedStrings) Creates a newCSVReader
instance.- Parameters:
regularExpressionSeperator
- A regular-expression in Java syntax for splitting a line by separator.firstLineHeaders
- Whether the first line of the CSV file contains headers or not.quotedStrings
- Whether strings should be quoted or not in the CSV file.
-
-
Method Details
-
read
Opens a CSV for reading.- Parameters:
filePath
- path to file- Returns:
- the opened-file (that must eventually be closed)
- Throws:
CSVReaderException
- if any error occurs while reading the CSV file.
-