How to read large csv files?

Yafuhenk

Active Member
Licensed User
Longtime User
Hi,

When reading csv files with StringUtils.Loadcsv I don't have any problem for files smaller than ± 2 MB. Larger files let the program crash.

I read on this forum that one should use Textreader. I did but still with larger files still let the program crash.
Does anybody knows how i can solve this?

This is de code I used to read the csv file:
B4X:
   Dim Reader As TextReader
      Reader.Initialize(File.OpenInput(File.DirRootExternal, "test4.csv"))
      Dim line As String
      line = Reader.ReadLine
      List1.Initialize
   Do While line <> Null
       Dim LineArray() As String
      LineArray = Regex.Split(";", line)
      List1.Add(LineArray)
        line = Reader.ReadLine
      Loop

Thanks for any feedback

Henk
 

paskuale

Member
Thanks guys all works ;) a new quest:

1)If my csv file not in atk folder but from ftp content ? How can retrieve it ?

2)I have no clear structure of folders & files on Android ...

:sign0098:
 
Upvote 0
Top