i dont quite understand by the given eg on opencsv site on how to use collection here List,eg is:
CSVReader reader = new CSVReader(new FileReader("yourfile.csv"));**
List myEntries = reader.readAll();**
I tried accessing a member of the List for eg System.out.println(myEntries.get(2)) but it gives me something like d1e604 and when i tested for existence of an element
boolean b = myEntries.contains("the element");** and it returns false.
what do i need to do to access the tokenized Strings?
by using readNext(), the elements are separated by “\n” and i want to assign the elements in a continuous no. of array.
while((tokened = reader.readNext()) != null){
int numOfArray = tokened.length;
System.out.println("number of items:"+ numOfArray) ;
for (int i = 0;i < numOfArray;i++) {
System.out.println(" tokenNo[" + i + "]: " + tokened[i]);
}
}
I think you missed a little fact about CSV. CSV is about lines AND columns.
readNext()returns an array of strings representing a line. So I would guess, readAll() returns a list of string[].