public class VCSVLocal
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static double[] |
getColumnOfNumbers(java.lang.String filePath,
int col)
Returns an array of numbers that exist in a certain column of a CSV file.
|
static java.lang.String[] |
getColumnOfStrings(java.lang.String filePath,
int col)
Returns an array of data that exists in a certain column of a CSV file.
|
static int |
getNumCols(java.lang.String filePath)
Returns the number of columns that contain data in a CSV file.
|
static int |
getNumRows(java.lang.String filePath)
Returns the number of rows that contain data in a CSV file.
|
static double[] |
getRowOfNumbers(java.lang.String filePath,
int row)
Returns an array of numbers that exist in a certain row of a CSV file.
|
public static int getNumRows(java.lang.String filePath)
filePath
- the path of the CSV file (with respect to the root directory
of the Java project).public static int getNumCols(java.lang.String filePath)
filePath
- the path of the CSV file (with respect to the root directory
of
the Java project).public static double[] getRowOfNumbers(java.lang.String filePath, int row)
This method throws java.lang.NumberFormatException
when the
input column contains a character that cannot be converted into a
double
.
filePath
- the path of the CSV file (with respect to the root directory
of the Java project).row
- the input row number (0-based index logic).public static java.lang.String[] getColumnOfStrings(java.lang.String filePath, int col)
filePath
- the path of the CSV file (with respect to the root directory
of the Java project).col
- the input column number (0-based index logic).public static double[] getColumnOfNumbers(java.lang.String filePath, int col)
This method throws java.lang.NumberFormatException
when the
input column contains a character that cannot be converted into a
double
.
filePath
- the path of the CSV file (with respect to the root directory
of the Java project).col
- the input column number (0-based index logic).