I have a string variable containing many lines of text, and I wold like to extract an entire line which contains a keyword.
For example, if my string is:
-66.48 ml End Phase (Issued) (Processing) (Completed)
-66.48 ml Phase Equilibration (Issued) (Processing) (Completed)
-66.48 ml Base SameAsMain
-66.48 ml Set mark “Equilibration” (Issued) (Processing) (Completed)
-66.48 ml Inlet A A1 (Issued) (Processing)
-66.46 ml Inlet A A1 (Completed)
-66.46 ml Inlet B B1 (Issued) (Processing)
I would like to extract the entire line which contains the text “SameAsMain”. So my output should be:
-66.48 ml Base SameAsMain
Can someone share how to do this?
Note: I am only showing a few lines of my variable here, my entire variable has a lot of lines.