I have a for loop for reading a file as list. The file content looks like below:
General family
private family
other family
Myname
myhouse
myfamily
Othername
otherhouse
otherfamily
From the above list, i want to pick only
Myname
Myhouse
Myfamily
Since the file will keep changing, Myname and the two below it will not always appear at the same place. They might even appear after Othefamily. So i would like to always search for Myname and then pick the next two entries below it. Something like in the below code. Please help
General family
private family
other family
Myname
myhouse
myfamily
Othername
otherhouse
otherfamily
From the above list, i want to pick only
Myname
Myhouse
Myfamily
Since the file will keep changing, Myname and the two below it will not always appear at the same place. They might even appear after Othefamily. So i would like to always search for Myname and then pick the next two entries below it. Something like in the below code. Please help
B4X:
Dim famlist As List
famlist=File.ReadList(File.DirAssets,"familymain.txt")
For i=0 To famlist.Size-1
Dim family As String
family=famlist.Get(i)
If family.Contains("Myname") Then
' Here i want to pick the next two entries after Myname
End If
Next