I think Olaf was pointing out that you missed some clarification, specifically
I suspect this is actually suppose to read where <LF> is the line-feed character. Otherwise some may read that as a question or get confused on what you’re actually asking for. Please understand there’s a lot of different folks from different places and sometimes things can be misunderstood quite easily.
In any case I think Olaf’s suggestion is probably a way forward. Regex can be helpful here I think and \n is the line feed character for regex. Might be able to create a capture group based on the required criterion then update as needed.
Play around on regex101 or any other regex tester of your choice. I have used regex101 quite a bit in the past and it works well in PS in my experience.