Extract line which contains specific text

Hi Guyz,

I want to extract a specific line which contains some text for example,

I have one text file, which contains more than 50 lines, but I want to extract which contains a specific word
“Control #: 394839009348354 other process requirements for analysis”
based on keyword “control #:” want to extract that whole specific line

Thank you.

Are those splitted by a new line? Can you give show us the text file maybe?

@gokulvasant you can give like this say the entire string is stored in a variable say outtext.now to get that use like this outtext.substring(outtext.indexof(“Control#:”)+“Control#:”.length).split(environment.newline.tochararray)(0). this is will give you the required output.

2 Likes

Got it, thank you.

1 Like

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