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
How do I delete blank lines using search and replace
MacBook Pro, OS X Yosemite (10.10), 8 GB RAM
What version of Pages?
Peter
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:
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:
What if you have a mixture of hard (pilcrow) and soft (carriage ↵ ) returns that looks like the following:
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.
Yep, that works fine; just seems like a huge complication of what was a straightforward procedure.
Apple got it wrong. They should have named it PITA, not Pages. 😉
This was really helpful — the issue was driving me nuts, as each day I have to copy from the web and paste into Pages and remove (until now, manually) hundreds of paragraph breaks. I knew how to show invisibles, and I was trying manually to copy them and paste into the Find/Replace box, but this just doesn't work. So counter-intuitive. I really appreciate the help, and am surprised at Apple. It took me a long time to track down this thread. Thanks.
Thanks, this really helped me.
Glad it helped you.
This does not work with Pages version 5.6.2 -- the carriage return does not get entered into the search or replace field. I am trying to replace ", " with a new line.
What works now?
Think you ignored the bit about using command e on the selection, or Copy and Paste to get the selection in the Find.
Peter
This is not working in Pages 5.6.1. I can copy or pastes the pilcrows ( great word btw) into the find window but bot found. Command E not working at all. Just does nothing.
Pressing command-e on a selection does absolutely nothing that you can see, but it does advance populate the Find field before you launch the Find interface. You then must select a replacement character, using one of these:
Sometimes, it is beneficial to select Whole Words from the Find panel gear icon.
It is insufficient to tell us that something did not work. Tell us a story about what you want to achieve with Find/Replace, what specifically is/are the individual find and replace character(s). Help us to help you.
Kitten is correct. 5.6.2 only marginally allows for the copy and replacement of invisibles. I have a 1,300 page document and am unable to use Find / Replace, Copy / Paste Styles, Create a Style etc. to deal with the removal of simple carriage returns en masse having converted HTML to plain text.
It seems incredibly backwards to progressively limit this feature so I will assume that nobody in this thread knows where Apple hid the solution which is so often the case... I am able to find and delete one line at a time, but perhaps you missed the 1,300 pages bit! Why not allow 'Styles to recognize carriage returns?
The trouble is that there are returns inside the paragraphs as well the need to add hard returns between paragraphs. I suspect adding a return en masse is impossible, but the simple internal return deletions MUST be possible even if only one paragraph at a time, although, did I mention 1,300 pages, 1,340 to be precise?
A solution would be appreciated.
So what is the pattern?
A hard return at the end of each line, or a soft return (a line feed), which needs to be replaced with a space?
Two returns at the end of each paragraph?
If you have this then it can be fixed but you also probably need to do a whole lot more cleaning up of the text. Bad spacing, punctuation, tabs, capitalisation etc.
No way would I do it in Pages simply because it is not built for large amounts of text.
Where has this text come from?
What format is it in?
What is the end result you wish to achieve?
Peter
Soft Returns at the end of each line. I'm manually adding a hard return between paragraphs currently.
I have tried Clean Text, Libre Office and Word with less success than Pages.
The text was originally HTML and has been substantially cleaned up. I made a short screenview video but the insert video directly above in this window is greyed....
End result is a legible document with proper paragraph spacing and preferably no spaces, as well a space between major paragraphs (which I suspect must be achieved manually).
Thanks Peter...
Link to screencast video on Dropbox. It shows the only method I currently know in Pages to eliminate Soft Returns (one line at a time).
https://www.dropbox.com/s/lk28jqx1kjpejle/Apple%20Return%20Issue.mov?dl=0
How do I delete blank lines using search and replace