Removing all line breaks in a chunk of text

Hello, I'm having trouble figuring out how to remove all line breaks from a chunk of text.

I'm copying text from PDFs which adds paragraph breaks between lines which I want to remove.

It seems it adds both a \n and a \r to the lines because neither

{=replaceregex({clipboard}, "\n", " ", "sg")}

nor

{=replaceregex({clipboard}, "\r", " ", "sg")}

do anything


I tried

{=replaceregex({clipboard}, "[\n\r]", " ", "sg")}

which replaces new lines with two spaces

and

{=replaceregex({clipboard}, "\n\r", " ", "sg")}

does nothing.

Help

nevermind, solved my own issue, I had the order wrong

the correct snippet is

{=replaceregex({clipboard}, "\r\n", " ", "sg")}

2 Likes

Welcome to the Forum! If there is anything else we can do to help or you have more questions, please let us know.