BrendonD

Q: 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

Close

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

  • All replies
  • Helpful answers

Previous Page 2
  • by SGIII,

    SGIII SGIII Aug 25, 2016 7:12 PM in response to KittenPetter
    Level 6 (10,796 points)
    Mac OS X
    Aug 25, 2016 7:12 PM in response to KittenPetter

    KittenPetter wrote:

     

    I have a lot of names separated by Comma-Space and I want a list of names separated by CarriageReturns [CR].

     

     

    One of the easiest ways is to use a simple script. Just select, copy, click, and copy-paste.  No need to know AppleScript to use.  A few seconds and you're done.

     

    1. Copy-paste script below into Script Editor (in Applications > Utilities)
    2. Select the comma space-separated names and command-c to copy them to the clipboard.
    3. Click the triangle 'run' button in Script Editor.
    4. Click in Pages (or wherever you want the list) and command-v to paste.

     

    (If you've not run a script on your machine before yyou may need to make sure Script Editor is checked at System Preferences > Security & Privacy > Privacy > Accessibility.)

     

    SG

     

    (*

    converts  text in form of name1, name2, name3, name 4

    to:

    name1

    name2

    name3

    etc.

    *)

     

    set inText to the clipboard as text

    set text item delimiters to ", "

    set tempList to inText's text items

    set text item delimiters to return

    set outText to tempList as text

    set the clipboard to outText

    display notification "Click somewhere and command-v to paste"

Previous Page 2