public class CsvReader extends Object
Constructor and Description |
---|
CsvReader(File inpFile) |
CsvReader(File inpFile,
char separator,
char quotechar)
Creates the CsvReader class object
|
CsvReader(File inpFile,
String separator,
String quotechar) |
CsvReader(Reader reader,
char separator,
char quotechar)
Creates the CsvReader class object
|
CsvReader(String filePath) |
CsvReader(String filePath,
char separator,
char quotechar)
Creates the CsvReader class object
|
Modifier and Type | Method and Description |
---|---|
String |
getData(int row,
int column)
Gets the data from csv file based on column and row number
|
int |
getNoOfColumn()
Return the number of column in the first row of the csv file
|
int |
getNoOfColumn(int rowNo)
Returns the number of the column of the said row number passed
|
int |
getNoOfRows()
Get the number of rows in the said csv file
|
public CsvReader(String filePath, char separator, char quotechar) throws IOException
filePath
- - File path of the csv file to be readseparator
- - Data separator to be used. Default value is ','quotechar
- - Quote character for the data. Default value is '"'IOException
public CsvReader(File inpFile, char separator, char quotechar) throws IOException
inpFile
- - Input csv file to be readseparator
- - Data separator to be used. Default value is ','quotechar
- - Quote character for the data. Default value is '"'IOException
public CsvReader(File inpFile, String separator, String quotechar) throws IOException
IOException
public CsvReader(String filePath) throws IOException
IOException
public CsvReader(File inpFile) throws IOException
IOException
public CsvReader(Reader reader, char separator, char quotechar) throws IOException
reader
- - Reader object of the file to be readseparator
- - Data separator to be used. Default value is ','quotechar
- - Quote character for the data. Default value is '"'IOException
public String getData(int row, int column)
column
- Column numberrow
- Row numberpublic int getNoOfRows()
public int getNoOfColumn()
public int getNoOfColumn(int rowNo)
rowNo
- - row number for which the number columns needs to be returned.Copyright © 2014. All rights reserved.