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

Way to move cells

Hi,


Basically I have all my entries in one column, is there an easy way to move them as in entry in row 1 (n>=0) be in column 1, entry in row 2 be in column 2, ..., entry in row 5 be in column 5, then entry in row 6 be in column 1, etc? I have around 1,000 entries thus I don't think its possible to do it manually. Any help?

MacBook Pro (Retina, 13-inch,Early 2015), iOS 9.0.2

Posted on Oct 10, 2015 10:47 AM

Reply
Question marked as Best reply

Posted on Oct 10, 2015 11:25 AM

Hello


Copy the column's data in Numbers to the clipboard, run the following shell script and it will put the reformatted data in the clipboard which you may paste in the destination range.



#!/bin/bash export LC_ALL=en_GB.UTF-8 pbpaste | paste - - - - - | pbcopy




If you're not familiar with shell scripting, here's an AppleScript wrapper which you can run in Script Editor.



do shell script "export LC_ALL=en_GB.UTF-8; pbpaste | paste - - - - - | pbcopy"




E.g., select range A1:A17 in the table below, copy the data to the clipboard, run the script, select C1 and paste (or paste and match style), which will populate the destination range C1:G4.


User uploaded file



Good luck,

H

4 replies
Question marked as Best reply

Oct 10, 2015 11:25 AM in response to Skipe_

Hello


Copy the column's data in Numbers to the clipboard, run the following shell script and it will put the reformatted data in the clipboard which you may paste in the destination range.



#!/bin/bash export LC_ALL=en_GB.UTF-8 pbpaste | paste - - - - - | pbcopy




If you're not familiar with shell scripting, here's an AppleScript wrapper which you can run in Script Editor.



do shell script "export LC_ALL=en_GB.UTF-8; pbpaste | paste - - - - - | pbcopy"




E.g., select range A1:A17 in the table below, copy the data to the clipboard, run the script, select C1 and paste (or paste and match style), which will populate the destination range C1:G4.


User uploaded file



Good luck,

H

Oct 10, 2015 11:46 AM in response to Hiroto

Sorry I never used Script Editor or anything like that. So I copy my column of data in numbers, then I open a new Script Editor, run the do shell script command you gave me above, then when I paste it will be divided into column?


I tried this and it didn't work?


EDIT:

Never mind, it works wonder. Thanks a ton you save me a lot of time!

Oct 10, 2015 11:30 PM in response to Skipe_

Number of - in paste(1)'s arguments corresponds to number of columns of result. So if you want 9 columns, use scripts below:



- shell script


#!/bin/bash export LC_ALL=en_GB.UTF-8 pbpaste | paste - - - - - - - - - | pbcopy




- applescript wrapper


do shell script "export LC_ALL=en_GB.UTF-8; pbpaste | paste - - - - - - - - - | pbcopy"




Regards,

H

Way to move cells

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