Hi,
I'm trying to load a CSV file from:
https://data.covid19india.org/csv/latest/districts.csv
This works fine (and fast).
This is extracting the unique names (I can see the log), but after a long time it displays an OutOfMemory error.
How do I get extract the unique names fast?
Want to list these names in a dropdown combobox.
The csv has 344127 lines!!
Regards.
I'm trying to load a CSV file from:
https://data.covid19india.org/csv/latest/districts.csv
Downloading from URL and saving to local folder:
Dim j As HttpJob
j.Initialize("", Me)
j.Download("https://data.covid19india.org/csv/latest/districts.csv")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
File.WriteString(Starter.rp.GetSafeDirDefaultExternal("csvinfo"), "district.csv", j.GetString)
Display_StateNames
Else
ToastMessageShow("Could not load State data.", True)
End If
j.Release
Then I'm trying to get the unique names using the following code:
Dim table As List = su.LoadCSV(Starter.rp.GetSafeDirDefaultExternal("pkinfo"), "district.csv", ",")
Log("Adding State names to combo box")
Dim ColNum As Int = 1
Dim newList As List
newList.initialize
For Each row() As String In table
If newList.indexOf(row(ColNum)) = -1 Then
newList.add(row(ColNum))
Log("State=" & row(ColNum))
End If
Next
cmb_states.cmbBox.AddAll(newList)
This is extracting the unique names (I can see the log), but after a long time it displays an OutOfMemory error.
java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack trace available
How do I get extract the unique names fast?
Want to list these names in a dropdown combobox.
The csv has 344127 lines!!
Regards.