Subscribe Bookmark RSS Feed

How to rearrange column data

Hi Guys,

I have a JMP file which has something like this:
Column1 Column2
1 44
2 556
3 67
4 667
5 1221

6 112
7 676
8 1121
9 1232
10 5655

So I have 25 rows with data in two columns, then a blank row followed by another 25 rows with data in two columns.

I would like something like this:

Column1 Column 2 Column3 Column4
1 44 6 112
2 556 7 676
3 67 8 1121
4 667 9 1232
5 1221 10 5655

How can I do this using a script?

Can I use transpose and use a blank line as a field separator?

Thanks
1 REPLY
chungwei

Staff

Joined:

Jun 23, 2011

I would first make a new column (call it a), assign value of 1 to the first 25 rows, value of 2 to the last 25 rows. delete the blank row. then do a split, split Column 1 and Column 2 by the new column.

Data Table( "test split" ) << Split(
Split By( :a),
Split( :Column 1, :Column 2 )
)