org.encog.util.csv
public class ReadCSV extends Object
| Constructor and Description |
|---|
ReadCSV(File file,
boolean headers,
char delim)
Construct a CSV reader from a filename.
|
ReadCSV(File file,
boolean headers,
CSVFormat format)
Construct a CSV reader from a filename.
|
ReadCSV(InputStream is,
boolean headers,
char delim)
Construct a CSV reader from an input stream.
|
ReadCSV(InputStream is,
boolean headers,
CSVFormat format)
Construct a CSV reader from an input stream.
|
ReadCSV(String filename,
boolean headers,
char delim) |
ReadCSV(String filename,
boolean headers,
CSVFormat format) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the file.
|
static String |
displayDate(Date date)
Format a date.
|
String |
get(int i)
Get the specified column as a string.
|
String |
get(String column)
Get the column by its string name, as a string.
|
int |
getColumnCount()
Get the column count.
|
List<String> |
getColumnNames() |
Date |
getDate(String column)
Get the column as a date.
|
double |
getDouble(int index)
Get the column as a double specified by index.
|
double |
getDouble(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 Date |
parseDate(String when)
Parse a date.
|
public ReadCSV(InputStream is, boolean headers, char delim)
is - The InputStream to read from.headers - Are headers present?delim - What is the delimiter.public ReadCSV(InputStream is, boolean headers, CSVFormat format)
is - The InputStream to read from.headers - Are headers present?format - What is the CSV format.public ReadCSV(File file, boolean headers, char delim)
filename - The filename.headers - The headers.delim - The delimiter.public ReadCSV(String filename, boolean headers, char delim)
public static String displayDate(Date date)
date - The date to format.public static Date parseDate(String when)
when - The date string.public void close()
public String get(int i)
i - The column index, starting at zero.public String get(String column)
column - The column name.public int getColumnCount()
public Date getDate(String column)
column - The column header name.public double getDouble(int index)
index - The column index, starting at zero.public double getDouble(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 CSVFormat getFormat()
public boolean hasMissing()
Copyright © 2014. All Rights Reserved.