Very Simple Question about readpdf with OCR and convert to text

I have what I suspect is a very simple question.

I have a piece of code running just fine that reads a pdf and converts it to text and saves it as a text file. This process creates multiple “lines” of text within the next file that closely match the PDF. So if text shows up at the bottom of the pdf, it shows up at the bottom of the text file. what I need is instead of converting it “the right way” so to speak, I don’t want those lines. I want just 1 very loooooooooong string all on one line.

Further Example:

Pdf looks like this:
Text abc123
I like dogs abc123

current Output:
“Text abc123
I like dogs abc123”

My desired output:
“Text abc123 I like dogs abc123”

So there are no separate lines so to speak, the pdf-to-text activity makes 1 incredibly long line. This will facilitate my scrapes better I have realized.

Thanks for the help!

alternatively, when the next chunk of code reads the text file I have saved and converts it to a string that is then used for scraping purposes, If the holding string could be manipulated to cut out the breaks in text that would also work.