How do I delete blank lines using search and replace

How do I delete blank lines using search and replace

MacBook Pro, OS X Yosemite (10.10), 8 GB RAM

Posted on Apr 24, 2015 12:03 AM

Reply
Question marked as Top-ranking reply

Posted on Apr 24, 2015 10:17 AM

Lets assume Pages v5.5.3 on your Yosemite. From your Pages View menu, Show Invisibles. This will show the hard and soft returns that appear to comprise those blank lines in your document. Let's deal with the hard returns first. By example the following has a single blank line between each character:

User uploaded file

Select the pilcrow below the A, and the one immediately behind the A. Then, in you would press command+E to use these two pilcrow character selections for your Find. The command+E is a shortcut from the Edit ▸ Find ▸ Use Selection for Find menu item. Now, just select the pilcrow behind the A, and choose Edit ▸ Find ▸ Use Selection for Replace. In short, we are replacing two pilcrow with a single pilcrow that will collapse the blank lines.


Press command+F, or Edit ▸ Find ▸ Find… , and your Find and Replace fields are pre-filled from the previous paragraph. Your find field will also report how many double-pilcrow matches it found. Then click Replace All. The result looks like the following:

User uploaded file

What if you have a mixture of hard (pilcrow) and soft (carriage ↵ ) returns that looks like the following:

User uploaded file

You would perform paragraph two again, this time selecting the carriage return behind the A, and the next pilcrow, followed by command+E. Then just select a single pilcrow for your replace sequence. Command+F, and replace all. This will leave you with the following, and for that extra hard (pilcrow) return in it, you now know how to remove it too.

User uploaded file

21 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How do I delete blank lines using search and replace

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.