Extract a sentence from a text file having a particular keywords

2019-11-15 16:28:44.380 [INFO] sg.com.income.cccc.gip.Gbhiux:67 - request message → {“userId”: “sxxxxx”,“userName”: “”,“roleId”: “245”,“modifiedBy”: “yyy”}

I would like to extract this complete sentence that includes “request message”. How should I do ?

Find the index of request message and then extract the sub string.

intIndex = strInput.FindIndexOf("request message")
strPart = strInput.SubString(intIndex)

Regards,
Karthik Byggari

Hi, thanks for replying but I had encountered this error saying “FindIndexOf” is not a member of ‘String’.
May I know where does this error come from and where should I change ?

For your additional information, I am using a read text file dependency to extract the sentences having that particular keywords

Sorry, please do the follwoing -

intIndex = strInput.IndexOf(“request message”)

Thank you so much for the reply!!! I gotten the value.

Another doubts from me, if I wanted to put the result into a text file. which activities should I use?

1 Like

This one -
https://docs.uipath.com/activities/docs/write-text-file

Can you please mark the post as solution.

Regards,
Karthik Byggari

Wrtie Text File Activity

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.