public final class CSVParser
extends java.lang.Object
Examples:
1. ,"abc 123", => abc 123
2. ,"abc" "123", => abc "123"
3. ,abc "123", => abc "123"
4. ,"abc "" 123", => abc " 123
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
UTF8_ENCODING
UTF8 encoding, used for hadling data in different languages.
|
| Constructor and Description |
|---|
CSVParser(java.io.InputStream pInputStream)
Constructor
|
CSVParser(java.io.InputStream pInputStream,
java.lang.String pEnc)
Constructor
|
CSVParser(java.net.URL csvFile,
java.lang.String encoding)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeFile()
Close the reader which will inturn close the inputstream.
|
java.lang.String[] |
getAttributeNames()
Validates whether data in current row of the file can be valid JBO attribute names
|
java.lang.String[] |
getLineValues()
Gets values of next line.
|
boolean |
isEndOfLine()
Tests if end of line has reached.
|
boolean |
nextLine()
Moves to the next line of the data.
|
void |
setQuoteChar(char ch)
Sets the quote character.
|
void |
setSeparators(char[] seps)
Sets the separator characters as a list of possible separators for the
data.
|
public static final java.lang.String UTF8_ENCODING
public CSVParser(java.io.InputStream pInputStream)
throws java.lang.Exception
pInputStream - CSV input streamjava.lang.Exception - any error occurredpublic CSVParser(java.io.InputStream pInputStream,
java.lang.String pEnc)
throws java.lang.Exception
pInputStream - CSV input streampEnc - character encodingjava.lang.Exception - any error occurredpublic CSVParser(java.net.URL csvFile,
java.lang.String encoding)
throws java.lang.Exception
csvFile - file to import data.encoding - Type of file encoding.java.lang.Exceptionpublic void setSeparators(char[] seps)
seps - Array of separator charactors.public void setQuoteChar(char ch)
ch - Quote character.public boolean nextLine()
throws java.lang.Exception
java.lang.Exception - any error occurredpublic java.lang.String[] getLineValues()
throws java.lang.Exception
java.lang.Exception - any error occurredpublic java.lang.String[] getAttributeNames()
throws java.lang.Exception
java.lang.Exceptionpublic boolean isEndOfLine()
public void closeFile()