Is there a way to remove all carriage returns from a selection of text?

Hi all,


I have a selection of text that I have copied in from Google Translate. The problem is that the text has inserted carriage returns at the end of every line from Google Translate which makes reading somewhat cumbersome.


Is there a way to select a section of text and then apply a command to remove all carriage returns from the selection?


Thanks in advance!

iMac, Mac OS X (10.7.2)

Posted on Dec 28, 2011 5:08 AM

Reply
17 replies

Dec 28, 2011 7:15 AM in response to burgundian

My guess is that you pasted the contents of the source block in the Find field.

Before :

User uploaded file

After :

User uploaded file


Yvan KOENIG (VALLAURIS, France) lundi 26 décembre 2011 12:03:51

iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2

My iDisk is : http://public.me.com/koenigyvan

Please : Search for questions similar to your own before submitting them to the community


For iWork's applications dedicated to iOS, go to :

https://discussions.apple.com/community/app_store/iwork_for_ios

Dec 28, 2011 7:26 AM in response to burgundian

The Find and Replace window is looking through the whole document so you don't have to specify which text to change. You specify the character you want found and replaced. As I said you select the carriage return shown in my image. Then you in the Replace field you add a space (you will not see it) just like you do in a text you write. Then you click on Replace All.

Dec 28, 2011 7:29 AM in response to KOENIG Yvan

It seems like that is the case, I assure you that I haven't. My Find & Replace window looks exactly like yous in the before screenshot.


The only difference between our two, would be that I have highlighted just a section of the document that I am trying to work with. So rather than doing a Find & Replace for the entire document, I am trying to only do it with a section of that document.


Maybe that is the problem. If a section is selected and highlighted does Pages think that is what you are trying to replace?

Dec 28, 2011 7:54 AM in response to burgundian

You were clear.

Look :

User uploaded file

As you may see, the text is splitted into three blocks :

a purple one

a selected red one

a green one

User uploaded file

I clicked the button [ Replace ] (Remplacer in French)

and the red block was replaced by a space character.


It seems that you discovered a huge bug.

I will look back in the User Guide to check if there is a described feature that I missed.

If there isn’t, I will file a bug report.

Happily after such a behavior we may trigger Undo but it's really annoying (even if I never faced it since january 2009 and even since august 2007 (delivery of Pages '08).



Not a bug but the described behavior :

User uploaded file

I understand why I never got it : quite always, nothing is selected and I use [ Replace All ] which doesn't behave the 'annoying way'.


Yvan KOENIG (VALLAURIS, France) lundi 26 décembre 2011 12:03:51

iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2

My iDisk is : http://public.me.com/koenigyvan

Please : Search for questions similar to your own before submitting them to the community


For iWork's applications dedicated to iOS, go to :

https://discussions.apple.com/community/app_store/iwork_for_ios

Dec 28, 2011 7:56 AM in response to burgundian

Click the insertion point where you want to start the find and replace. Use the button Replace and Find and it will change one at the time as long as you like. If nothing happens try instead the Paragraph break character.


There might be a non break character in the text. Use Show invisibles from the View menu so you can see it and copy it. Paste in the Find field.

Dec 28, 2011 8:18 AM in response to fruhulda

So this is intended behaviour. Maybe it's just me, but the functioning of that seems counter-intuitive. I can't imagine that I'm the only person that has ever wanted to just run a Find & Replace on a section of text within a larger document without having to change the whole document and (with all appreciation and kudos to fruhulda's suggestion) without having to go through each instance one at a time.


Aside, I did try furhulda's suggestion and that does indeed work. It just makes it a little tedious to have to do them one at a time, but it is far better than keying through the document and hitting delete, space, key to the next one, & repeat.


I did a little more digging and it seems this has been a complaint with Pages for awhile now. It seems it is a normal function of Word, but I really really really do not want to go back to using Word even for small tasks.


Thanks again!

Dec 28, 2011 8:32 AM in response to burgundian

Well, it is also a matter of what you want changed. Carriage return aren't that many in a from Internet pasted text. Most of them are paragraph breaks.


For a section of text you can always copy and paste the section of text into a blank document. Do the Find and replace with Replace All. Copy again and paste back into the original document.


You don't have to go back to Word. You just have to learn another way to work. Pages doesn't have all the "features" Word has. That is probably why Pages is cheaper to buy!!!

Dec 28, 2011 8:34 AM in response to burgundian

Apple deliver a Pages User Guide which we are supposed to read.

When the app behave a 'surprising' way which matches the User Guide we have to ask our brain to remember that so that we will not reproduce our error.

As Fruhulda wrote, if you start with a return selected, clicking the button [ Replace & Find ] several times will achieve your goal.


Every user must understand that an application obey to rules defined by the engineers, noy by us !


If something is counter-intuitive,

it's the fact that Pages has (at least in the French version) a button [ Find & Replace ] which replace before searching !


If you want to apply Find & Replace to a selected block, a neat workaround was described several times.

When the block is selected, Copy it, Paste in a blank document

Apply Find & Replace

Select All, Copy and Paste above the selected block in the original document.


Yvan KOENIG (VALLAURIS, France) lundi 26 décembre 2011 12:03:51

iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2

My iDisk is : http://public.me.com/koenigyvan

Please : Search for questions similar to your own before submitting them to the community


For iWork's applications dedicated to iOS, go to :

https://discussions.apple.com/community/app_store/iwork_for_ios

Dec 28, 2011 8:52 AM in response to burgundian

Yes pages is cheaper to buy, but I guess I just expect the best from Apple. And that *usually* means features that are user intuitive rather then engineer defined that can also be modified to fit the user's needs.


It's just a different philosophy of customer service and use, versus engineer design. Rather than developing a workaround, I would hope that engineers would respond to user needs and evolve the software. But that discussion will just hijack the topic into one of the philosophy of design and customer service. And we all know there are more than enough of those debates on the forums to last us all a lifetime.


Once again, thank you both for the suggestions and solutions!

Dec 28, 2011 9:23 AM in response to fruhulda

Hello Fruhulda


Trying to replace Carriage Return or Paragraph Break doesn't matter here.

The app behave the same in both cases except that if we apply [ Replace ] with a Carriage return selected when we ask to Find & Replace Paragraph Break, it will be replaced.


Don't worry but I wish to repeat that what is really odd is that :

the button is named [ Find & Replace ]

the related menu items are all named Find…

the dialog is entitled Find & Replace


and when we trigger [ Find & Replace ], it replace the selection before searching


CAUTION, I write using the litteral translation of the French items.

The English User Guide use :

Replace All

Replace

Replace & Find


Checking in the French User Guide, I discover that it use also Replacer et Rechercher

User uploaded file

But in the application, the button is named [ Rechercher et remplacer ]


It's odd.

I'm a bit anxious because, even if I don't retrieve it, I remember that I wrote a report about an inconsistency. Pages.

In iWork '08, the Find/Replace French dialogs were :


User uploaded file

User uploaded file

As you see, one used Rechercher et remplacer while the other use Remplacer et rechercher.

My memory tell me that I wrote something like "change in the first or change in the second doesn't matter but change in one" which was really a bad idea.


As I don't retrieve such report in my archives, I'm not sure that I really filed it.

I will go to the radar area.

If I really made this error, I will send apologies and ask them to move back in iWork '12 !


Yvan KOENIG (VALLAURIS, France) lundi 26 décembre 2011 12:03:51

iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2

My iDisk is : http://public.me.com/koenigyvan

Please : Search for questions similar to your own before submitting them to the community


For iWork's applications dedicated to iOS, go to :

https://discussions.apple.com/community/app_store/iwork_for_ios

Dec 28, 2011 9:31 AM in response to KOENIG Yvan

Yvan, you are mixing apples and pears. I didn't say anything about that the application would behave differently if using paragraph break instead of carriage return. It was a tip to the OP because the two characters look the same and it might be that the OP doesn't get desired result wen using carriage return in Find and Replace.


What is the behavior of the french Rechercher et remplacer? Does it Find first and then replace or vice versa? Can't it just be a typo?

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.

Is there a way to remove all carriage returns from a selection of text?

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