Subscribe Bookmark RSS Feed

Copying and Pasting Cells

natalie_

Community Trekker

Joined:

Jan 6, 2016

Hi Everyone,

I have a huge file which have many different tests.  It looks like each test was appended to the original csv file.  I would like to copy and paste the cells which contain the header, and put them into a list.  It doesn't matter to me if it is in the same data table or a new one.  I would like to write a script to do this.  All the tests will be evenly spaced. 

I can't share the file, but here is a better visual for what I am looking for. 

The data:

10755_pastedImage_0.png

The result I would like:

10756_pastedImage_1.png

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

I also tried this, and it works!  I don't know if this is the most efficient way to parse data though?

path = "C:\R&D Data\JMP";

fileName = "Sample Table.jmp";

dt = Open(path||"\"||fileName); //open data table

Current Data Table()<<Select Rows (Index(1,10));

dt<<Subset(Columns(Index(1,4)),Rows(Index(1,10)), Linked, Output Table Name ("New Table"));

3 REPLIES
Byron_JMP

Staff

Joined:

Apr 26, 2012

Do you need a script to do this many times, or just need to get it done once quickly?

To do it quickly, open the file, then use this script (  Fill in Missing Cells  ) to get the site and Y copied to each row.

select one row with the headers, use select matching cells, delete the rows. also do this with the blank rows.

Then use Tables>split to get your final table.

natalie_

Community Trekker

Joined:

Jan 6, 2016

Thanks Byron,

This is a good resource for me.

I am looking for a script because I will have to do this many times.  Is it possible to move rows to a different data table?

I was thinking something like this.  It does select the rows and make a new data table.  It doesn't move the rows over yet because I am not sure of the syntax for it. 

path = "C:\JMP";

fileName = "Sample Table.jmp";

dt = Open(path||"\"||fileName); //open data table

Current Data Table()<<Select Rows (Index(1,10));

dt2=New Table("My Table");

dt << Move Rows(dt2);

Solution

I also tried this, and it works!  I don't know if this is the most efficient way to parse data though?

path = "C:\R&D Data\JMP";

fileName = "Sample Table.jmp";

dt = Open(path||"\"||fileName); //open data table

Current Data Table()<<Select Rows (Index(1,10));

dt<<Subset(Columns(Index(1,4)),Rows(Index(1,10)), Linked, Output Table Name ("New Table"));