Scribus Forums

Scribus => General Discussion => Topic started by: a.l.e on October 17, 2026, 07:16:07 PM

Title: Joining lines from pasted text
Post by: a.l.e on October 17, 2026, 07:16:07 PM
When copying text from a PDF, we often get the text line by line.

https://github.com/aoloe/scribus-script-repository/tree/master/join-lines

Today, I wrote a script that joins those lines in paragraphs.

If you copy the "scribus-script-repository" repository on your disk and add it to your script folders in "Preferences > Scripts", then you can simply run it from the Scripts menu:

join-lines.gif



Of course, you can also just copy the Python file in your own collection of scripts.

Please read the README in the folder linked above for the exact behavior of the script.
Title: Re: Joining lines from pasted text
Post by: utnik on October 18, 2026, 09:06:29 AM
hi ale

thank you! saves a lot of work.

utnik
Title: Re: Joining lines from pasted text
Post by: NorrisFByrd on November 11, 2026, 07:27:32 AM
This is handy. I paste a lot of text from old PDFs into our newsletter, and the broken lines drive me round the bend. I will give the script a try next time I have a long piece to clean up.
Title: Re: Joining lines from pasted text
Post by: Nermander on November 15, 2026, 06:51:13 AM
In MS Word I used to just do a few search and replace.

Replace all ^p with ^l.
Replace all ^l^l with ^p
Replace all (remaining) ^l with space.
Then as cleanup you can replace all double spaces with a single space. May need to run more than once.

But ok, I eventually put these into a simple Word macro.
Title: Re: Joining lines from pasted text
Post by: a.l.e on November 15, 2026, 09:03:29 AM
Indeed, depending of the content you're "joining" a set of search and replace will give you better results, since it will keep the formatting.

From a quick check, I don't think that Scribus provides access to the Search and Replace function... we will need to change that : - )