public class ReadCSV
extends java.lang.Object
| Constructor and Description |
|---|
ReadCSV(java.io.File file,
boolean headers,
char delim)
Construct a CSV reader from a filename.
|
ReadCSV(java.io.File file,
boolean headers,
CSVFormat format)
Construct a CSV reader from a filename.
|
ReadCSV(java.io.InputStream is,
boolean headers,
char delim)
Construct a CSV reader from an input stream.
|
ReadCSV(java.io.InputStream is,
boolean headers,
CSVFormat format)
Construct a CSV reader from an input stream.
|
ReadCSV(java.lang.String filename,
boolean headers,
char delim) |
ReadCSV(java.lang.String filename,
boolean headers,
CSVFormat format) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the file.
|
static java.lang.String |
displayDate(java.util.Date date)
Format a date.
|
java.lang.String |
get(int i)
Get the specified column as a string.
|
java.lang.String |
get(java.lang.String column)
Get the column by its string name, as a string.
|
int |
getColumnCount()
Get the column count.
|
java.util.List<java.lang.String> |
getColumnNames() |
java.util.Date |
getDate(java.lang.String column)
Get the column as a date.
|
double |
getDouble(int index)
Get the column as a double specified by index.
|
double |
getDouble(java.lang.String column)
Get the specified column as a double.
|
CSVFormat |
getFormat() |
int |
getInt(int i)
Obtain a column as an integer referenced by a string.
|
boolean |
hasMissing() |
boolean |
next()
Read the next line.
|
static java.util.Date |
parseDate(java.lang.String when)
Parse a date.
|
public ReadCSV(java.io.InputStream is,
boolean headers,
char delim)
is - The InputStream to read from.headers - Are headers present?delim - What is the delimiter.public ReadCSV(java.io.InputStream is,
boolean headers,
CSVFormat format)
is - The InputStream to read from.headers - Are headers present?format - What is the CSV format.public ReadCSV(java.io.File file,
boolean headers,
char delim)
file - The file.headers - The headers.delim - The delimiter.public ReadCSV(java.lang.String filename,
boolean headers,
char delim)
public ReadCSV(java.lang.String filename,
boolean headers,
CSVFormat format)
public ReadCSV(java.io.File file,
boolean headers,
CSVFormat format)
file - The file.headers - The headers.format - The format.public static java.lang.String displayDate(java.util.Date date)
date - The date to format.public static java.util.Date parseDate(java.lang.String when)
when - The date string.public void close()
public java.lang.String get(int i)
i - The column index, starting at zero.public java.lang.String get(java.lang.String column)
column - The column name.public int getColumnCount()
public java.util.Date getDate(java.lang.String column)
column - The column header name.public double getDouble(int index)
index - The column index, starting at zero.public double getDouble(java.lang.String column)
column - The column name that we want to get.public int getInt(int i)
i - The column header name being read.public boolean next()
public java.util.List<java.lang.String> getColumnNames()
public CSVFormat getFormat()
public boolean hasMissing()