Android Tutorial LoadCSV and listview.addtwolines

I'm having trouble understanding how csv files are loaded. I've read all the tutorials and posts I could find, but I can't get a grip on it.
With a textreader I can read a line and then do something with it. I can't seem to do the same with csv files.
I have a csv file with 2 items per line, comma seperated, and multiple lines.
I want to load a line, check if it meets my criteria the put it into a listview.addtwolines, and then repeat. I'd be happy to put it into a multidimensional array also.
Any help with the code and logic would be greatly appreciated.
Thanks
Jamie...
 

Jamie

Member
Licensed User
Longtime User
Figured out how to get the whole file into the phone. Used Erels example and realized where my problem was
For i = 0 To table.Size - 1
Dim cells() As String
cells = table.get(i)
for c = 0 To cells.Length - 1
Log(cells(c))
Next
Next
Realized that cells.Length was how many items were on each line.
So I did this...

Dim su As StringUtils
Dim List1 As List
List1.Initialize
List1 = su.LoadCSV(File.DirAssets, "Cust.csv", ",")
For i = 0 To List1.Size - 1
Dim cells() As String
cells = List1.get(i)
ListView2.AddTwoLines(cells(0),cells(1))
Next
Good enough to get the whole file.
Would still like to know if I can just bring in 1 line at a time and use or discard it.
Thanks.
 
Top