I’m using `OpenCSV` and it reads line-by-line of a...
# announcements
n
I’m using
OpenCSV
and it reads line-by-line of a CSV file via a
csvObject.readMap()
. I want to go through and collect each line into a
ArrayList
.
readMap
is done when it hits a null (empty line). What’s the best way to repeatedly call
readMap
and then put the result in an array?
Copy code
do {
    val line = csv.readMap()
    csvLines.add(line)
} while (line != null)
this works but then the list has a null in it. i’d rather not have to do two null checks if possible.