Hi I have a need for a download counter for some of my zip files!
I have the download counters output via php and i get output like a CSV
So
Zipfromjack,102
bobsZip,3049
philszip,393
...
is my list.
I can read the list and currently use a long winded way to read them like so code originally from @margret's example
The question is rather than do all the Case "bobszip" how can I load the values into the correct variables?
Thanks
Aidy
I have the download counters output via php and i get output like a CSV
So
Zipfromjack,102
bobsZip,3049
philszip,393
...
is my list.
I can read the list and currently use a long winded way to read them like so code originally from @margret's example
B4X:
DIM BOBZIP, ZIPFROMJACK, PHILSZIP As String
Sub convCSV
Dim su As StringUtils
Dim list1 As List
list1 = su.LoadCSV(File.DirApp, "test.csv", ",")
For i = 0 To list1.Size-1
Dim sCol() As String
sCol = list1.Get(i)
Dim NewRow As String
For il = 0 To sCol.Length-1
NewRow = NewRow & sCol(il)
If il < sCol.Length-1 Then
Select NewRow
Case "Zipfromjack"
ZIPFROMJACK=sCol(il+1)
Log ("ZipFromJack = "&ZIPFROMJACK)
Case "bobsZip"
BOBSZIP=sCol(il+1)
Log ("bobsZip = "&BOBSZIP)
Case "philszip"
PHILSZIP=sCol(il+1)
Log ("PhilsZip = "&PHILSZIP)
End Select
'NewRow = NewRow & " - " - Removed for example
End If
Next
'Log(NewRow) - Removed for example
Next
End Sub
The question is rather than do all the Case "bobszip" how can I load the values into the correct variables?
Thanks
Aidy