As @momlo correctly pointed out, it can be done much more efficiently with a Parse text action using regular expressions.
But with the context that we have here, using Split text to split the text with a new line as the delimiter, would convert the text into a list of strings for each line. Then using Set variable to set some new variable as %TextList[0]% would result in the first line of the string.
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.