Gren.

How to remove line breaks from text copied from a PDF or email

Copy a paragraph out of a PDF or an old email and it often arrives in short lines, with a break in the middle of each sentence. Gren's Join broken lines puts them back together in one go, and leaves your paragraphs, lists and headings as they were.

Updated · 4 minute read

Why the lines break

A PDF keeps text the way it was laid out on the page, one line at a time. When you copy from it, every line comes with a line break at its end, even in the middle of a sentence. A word split across two lines with a hyphen comes out split too.

Plain-text emails break for a different reason. The email standard asks for lines of no more than 78 characters, so many email programs wrap long lines before sending. Quote a reply in another reply and the lines break again.

The arrows mark the breaks Gren removes. The gap between the two paragraphs stays.

How to join the lines with Gren

  1. Copy the text from the PDF or email.
  2. Open gren.app and paste it into a note.
  3. Press Cmd K (Ctrl K on Windows, or the magnifying glass on a phone) and choose Join broken lines. To fix one part of a note, select it first.
  4. Gren says how many lines it joined. Cmd Z puts them back.
The message Gren shows after joining the example above.

What Gren joins, and what it leaves

Gren joins a line to the next only when the break clearly came from wrapping: the line is long, it does not end a sentence, and the next line carries on in lower case. That keeps the parts of your text that should stay on their own lines.

A line that ends in a hyphen joins straight onto the next, with the hyphen kept. That keeps a word such as well-known whole, but a word the PDF split in two, such as recom-mendation, needs its hyphen taken out by hand.

Without Gren: find and replace in Word

Word can do it with three replacements, using ^p, its code for a line break:

  1. Replace ^p^p with a marker that is not in your text, such as ###. This keeps the gaps between paragraphs safe.
  2. Replace ^p with a single space.
  3. Replace ### with ^p^p.

If nothing changes, the breaks may be manual line breaks: use ^l in place of ^p. This joins every line, so headings and list items end up glued to the line before. Gren leaves those alone.

Tidy the spacing as well

Copied text often brings double spaces and runs of blank lines too. Tidy spacing, in the same command list, turns each run of spaces into one and leaves at most one blank line between paragraphs.

Questions

Why does text copied from a PDF have line breaks?

A PDF keeps text as it was laid out on the page, one line at a time. Copying it brings a line break from the end of every line, even in the middle of a sentence.

Will Join broken lines merge my paragraphs?

No. A blank line between paragraphs is never joined, and neither are list items or short lines such as headings.

Can I fix just part of a note?

Yes. Select the lines first and Gren joins only those.

Can I undo it?

Yes. Press Cmd Z (Ctrl Z on Windows) straight after, or bring back an earlier version from Version history.

Is it free?

Yes. Gren is free, needs no account, and your text stays in your browser.