How to cut from some point to the bottom(Textarea)

Hi,

Textarea text is appended through the async shell.
It works well.

One problem is that I need to parse only the lines after some point.
For example, if textarea has 1,000 lines and there are “HERE” characters in the middle of the area, I should cut text from the point to the bottom.

Without AWK utility, is there any native way in Xojo to accomplish this requirement?

Thanks in advance.

Set SelStart to the starting position of the text you want to remove:

TextArea1.SelStart = startingPosition TextArea1.SelLength = TextArea1.Text.Len - TextArea1.SelStart TextArea1.SelText = ""

Thanks.
I feel I should change my question. I need to remove from the top to the position of some text.
Eventually, I am going to parse the rest of the text.

Eg. 1000 line of text area.
The line of the text is 900, then I need to parse with between 900 ~ 1000.

By the way, how can I find the ‘startingPosition’ of the some text?

I think I can find the ‘startingPosition’ with the code below.

Dim charPos As Integer = InStr(Window1.ResultBufferTextArea.Text, "HERE")
  
  If charPos > 0 Then
    Window1.ResultBufferTextArea.ScrollPosition = Window1.ResultBufferTextArea.LineNumAtCharPos(charPos)
    MsgBox " ScrollPosition ,,, " + str(Window1.ResultBufferTextArea.ScrollPosition)
  Else
    // InStr returns 0 if no match was found.
  End If

Then, how can I remove the text from top to the ‘startingPoint’?

The same way I showed you. Set the start and end of your selection and then clear it:

TextArea1.SelStart = 0 TextArea1.SelLength = charPos TextArea1.SelText = ""

Thank you so much. It works great!!