B4J Question how to read .txt files columns and rows

Cal4th

Member
I am Trying to read a.txt file that is divided in columns and rows.

i have accomplish reading the rows but i find a way to let the program know that when a space comes , it needs to write it in other object.

my .txt looks like this:
# x y Cp
1.00000 0.00158 0.25753
0.99289 0.00282 0.23875
0.98126 0.00482 0.20357
0.96830 0.00703 0.17033
0.95389 0.00944 0.13856
0.93812 0.01203 0.10883
0.92134 0.01473 0.08145
0.90398 0.01748 0.05721
0.88632 0.02021 0.03509
0.86847 0.02292 0.01564

the code i use to read the rows is:
B4X:
    Dim CpALL As List: CpALL.Initialize

    CpALL=File.ReadList(File.DirApp,"0.txt")
    Dim Cp As List: Cp.Initialize
   
    For i = 0 To CpALL.Size - 1
        Cp.Add(CpALL.Get(i))
        Log(Cp.Get(i))
    Next
 
Top