Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Advanced Find and Replace. How to replace space with carriage return?

10.9.13.0/24, 10.9.4.2/32, 10.9.4.3/32



into


10.9.13.0/24
10.9.4.2/32
10.9.4.3/32



Find replace ", " with carriage return.


I keep find articles about an advanced find and replace but I can't seem to locate it.


OS X El Capitan 10.11.3

Numbers 3.6.1

Posted on Feb 8, 2016 4:45 PM

Reply
Question marked as Best reply

Posted on Jul 30, 2017 10:50 PM

Hi tagprez,


Good call.

For those who don't like "Use Selection for Find/Replace" but prefer to type a code, Numbers and Pages uses \n for a carriage return (newline).


Replacing comma space with newline:

User uploaded file

Replace All

User uploaded file


Regards,

Ian.

17 replies

Feb 8, 2016 6:13 PM in response to BrendonD

Hi Brendon,


Correct. Any combination of keystrokes separated by hyphens means "Press and hold all keys except the last in the list, then tap the last key, then release all."


Other examples:

shift-command-3 (takes a screen shot and saves it as a file on the desktop)

shift-command-4 (changes the mouse pointer to a cross hair, with which you can select a portion of the screen. Takes a screen shot of the enclosed area when the mouse in released, and saves it as a file on the desktop.

shift-control-command-3

shift-control-command-4 These take the screen shots described above, but place the result on the Clipboard, not in a file.


option-return or option-tab should place a return (or tab) into the Find or Replace box depending where you have the insertion point. You should see a Pilcrow symbol ( ¶ ) in the box. Example below (in Numbers '09).

User uploaded file


Regards,

Barry

Feb 8, 2016 6:21 PM in response to Barry

Hi Barry,


Unfortunately you will find that this does not work in Numbers 3.6.1. It seems that sometime round 2010 Apple removed the advanced find and replace axing the use of reg expressions and other features other than basic string replacement.


Even though the option-return works inside a cell it is not a valid entry in the replace field under 3.6.1.


I have since copied my data to excel and used VBA code to implement the change before bringing it back. Of course if someone does figure out a way to do this in Numbers that'd be swell.


Regards,

Brendon

Feb 9, 2016 1:55 AM in response to BrendonD

Hi Brendon,


In Numbers 3, click on the View button in the ToolBar

User uploaded file

Choose Show Find & Replace

User uploaded file

In the Find box, type comma space.

Insert a text box and type a single return character (press the enter key) and select that return.

User uploaded file

Menu > Edit > Find > Use Selection for Replace

User uploaded file

The return doesn't show, but it is there in the Replace box.

Click on Replace All to replace every occurrence in that document.

From Numbers Help: Find and Replace Text:

User uploaded file

User uploaded file


Regards,

Ian.

Feb 9, 2016 2:56 PM in response to Yellowbox

Hi Ian,


I appreciate the detail of your response, unfortunately again this has not worked. The carriage return, appearing in the text box exactly as in your steps, translates into a space in the replace window. Then when the replace all function is used, a space not carriage return is added in substitute.


I'd like to think this issue isn't specific to my computer but logically this may be the case if the above steps perform as advertised on another with the same 3.6.1 version of numbers.


Regards,

Brendon

Feb 9, 2016 5:09 PM in response to BrendonD

It happens that I just spent an hour devising various futile approaches to substituting spaces for carriage returns in a Pages document. They included all the tricks described above. What's most frustrating is that on my older iBook, AppleWorks does this routinely. I believe \p represents the carriage return, or you can type one and copy it. Unhappily, Apple's attempts to gussy up their apps don't include leaving the good parts alone, or in AppleWorks' case, not tinkering with it at all.

Feb 9, 2016 7:09 PM in response to BrendonD

BrendonD wrote:


unfortunately again this has not worked. The carriage return, appearing in the text box exactly as in your steps, translates into a space in the replace window. Then when the replace all function is used, a space not carriage return is added in substitute.



Hi Brendon,


It took me a while figure out what I was missing, but Ian's method definitely works here in v. 3.6.1. Here's what worked:


  1. Type , followed by a space in the first box in 'Find & Replace' dialog.
  2. Create a text box by clicking the icon in the toolbar, type return once to put the focus in the new text box, and another return to put an invisible return character in it. Then select the entire contents (two lines consisting of one invisible character) of the text box (I typed command-a to do this).
  3. With the contents of the text box selected, in the menu Go to Edit > Find and choose 'Use Selection for Replace'
  4. Click 'Replace All' in the 'Find & Replace' dialog.


SG

Feb 9, 2016 7:28 PM in response to SGIII

I can verify that, as obtuse and counter-intuitive it is (to say nothing of profoundly un-Apple-like), SGIII's procedure does actually work. Quite consistently, in my experience. I had to learn this unpleasantry a few days ago. Ugh.


Its clumsiness is so bad it almost disappoints me that it works, but... well, Bob's your uncle. In this case, Bob is an overweight heavy drinker who doesn't use deodorant, but he does actually do his job.

Mar 9, 2016 5:17 AM in response to macmikey

I'm with macmikey on this - although it does work it is horribly frustrating and one of the best reasons not to use Pages. The idea that you can functionally track so much detail required to control all three variables here: the scope of your find/replace, the find characters and the replace characters is utterly ridiculous when the software does not show you what the heck is happening as it is happening. To me the idea of "invisibles" in a word processor is frankly arrogant and insulting. I use MS-Word for OSX because it is a huge time saver. That product shows you what you need to see to easily control all of the variables. And you'll not need to resort to reading forums to figure things out.

Advanced Find and Replace. How to replace space with carriage return?

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