Hi,
I am looking to parse blocks of text (I have a sample attached).
Specifically I want to extract the data between $$SOE and $$EOE, then take this data and split it up by the commas. I was planning to use regex.split to do both parts of this.
I have tried the first stage, splitting the data up with a split pattern of "$$", but this hasn't worked.
I welcome any advice on my method or suggestions of better ways to do this. Ive attached a sample of the full data I am parsing.
Many thanks
Stephen
I am looking to parse blocks of text (I have a sample attached).
Specifically I want to extract the data between $$SOE and $$EOE, then take this data and split it up by the commas. I was planning to use regex.split to do both parts of this.
I have tried the first stage, splitting the data up with a split pattern of "$$", but this hasn't worked.
B4X:
Dim text As String
text = "Unwanted text here including CRLF etc $$SOE 2457445.638888889, A.D. 2016-Feb-27 03:20:00.0000, -3.434088981408140E+00, -9.406082070997213E+00, 3.002006542448317E-01, 4.935555086865448E-03, -1.935056934039580E-03, -1.632165803143835E-04, 5.785831922971549E-02, 1.001785743017802E+01, 1.201026543732353E-04, $$EOE unwanted text after here and more CRLF "
data2 = Regex.Split("$$",text)
' Im looking to extract all of the values between $$SOE and $$EOE, split by commas into a string array
Dim l As List
l.Initialize2(data2)
Log(l)
End Sub
I welcome any advice on my method or suggestions of better ways to do this. Ive attached a sample of the full data I am parsing.
Many thanks
Stephen