Split text in numbers

Hello, how can i split text in different cells?


PS: text to columns workflow not working...

Posted on Feb 19, 2016 12:15 PM

Reply
17 replies

Feb 19, 2016 1:19 PM in response to HenriRaSu

So if I understand you correctly, after pasting in from Pages you have something like this?


User uploaded file


And you want to split the name into First and Last name, with First in one column and Last in another?


If so, you can do this:


Select the cells with the data you want to split, here A2:A3:


User uploaded file



With the cells still selected, choose 'Text to Columns' from the Numbers > Services menu and choose Space as your delimiter (I'm assuming there's a space between the first and last name).


User uploaded file


Click once in cell C2 and command-v or Edit > Paste and Match Style, giving you this:


User uploaded file


Add header labels for columns C and D and delete column A, resulting in:


User uploaded file


SG



P.S. This assumes you are using this Automator Service (Dropbox download).

Feb 19, 2016 12:45 PM in response to SGIII

Ok, thanks for helping


I'm working in numbers and i have to separate my data like this:

My data, that i copy and paste from pages - first name and last name(in the same cell) | email - 2 cells
I want - email | First name | Last name - 3 cells
-------
I don't know what i'm doing wrong, becuse i tried the formula that i found in the internet, and got nothing. Same with your tips about the ' text to columns automator workflow '. Says that variable csvString is not defined.
PS : Sorry for the bad english, i'm brazilian.
Thanks,

Feb 19, 2016 3:09 PM in response to HenriRaSu

Hi, I've retested the Service here and don't get an error... UNLESS I have Numbers 2 (part of iWork '09) open at the same time. This Service only works with Numbers 3 and will get confused if Numbers 2 is also open, even if you have a different document open in Numbers 2. Could that be the problem on your machine?


SG

Feb 19, 2016 4:48 PM in response to HenriRaSu

HenriRaSu wrote:


Actually, haha i don't know. I have a macbook air 2015 OX el capitan, and the version of numbers is 3.6.1(2566).
If there's a problem on my machine, i can't tell... 😟


I didn't mean to suggest there is a problem on your machine! I meant perhaps the reason the Service was having problems was because you had Numbers 2 open along with Numbers 3. Many people run both versions.


There may be something with Brazilian localization the Service does not like. It's hard to debug from here. If you only need to split first name and last name then you can use a much simpler script (there is also a way to do this with formulas that is not hard).


The simpler script is below. Just copy-paste it into Script Editor (in your Applications > Utilities folder).


Then select the cells that contain the first and last names together (A2:A3 in my example, C2 in your example) and click the triangle 'run' button in Script Editor. Then click once in a destination cell (in my example C2) and type command-v or choose Edit > Paste and Match Style to paste the split text into separate columns.


SG


tell application "Numbers"

tell front document to tell active sheet

tell (first table whose selection range's class is range)

set selRange to selection range

set pasteStr to ""

tell selRange to repeat with c in cells

set v to c's value as text

set f to v's first word

set l to v's last word

set pasteStr to pasteStr & f & tab & l & return

end repeat

end tell

end tell

end tell


set the clipboard topasteStr

return pasteStr

Feb 21, 2016 9:30 AM in response to HenriRaSu

Hi HRS1,


That's a message you get when Numbers can't find an open document.


For this script to work you must first:


  1. Already have Numbers 3 open (and Numbers 2 must not be open).
  2. Already have a document open in Numbers 3.
  3. Already have selected cells in that document.



Also, make sure Script Editor is checked at System Preferences > Security & Privacy:


User uploaded file



SG

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.

Split text in numbers

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