cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
natalie_
Level V

Copying and Pasting Cells

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
natalie_
Level V

Re: Copying and Pasting Cells

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"));

View solution in original post

3 REPLIES 3
Byron_JMP
Staff

Re: Copying and Pasting Cells

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.

JMP Systems Engineer, Health and Life Sciences (Pharma)
natalie_
Level V

Re: Copying and Pasting Cells

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);

natalie_
Level V

Re: Copying and Pasting Cells

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"));