It’s World Statistics Day! To honor the theme of the day, the JMP User Community is having conversations about the importance of trust in statistics and data. And we want to hear from you! Tell us the steps you take to ensure that your data is trustworthy.
Choose Language Hide Translation Bar
Highlighted
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
Highlighted
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
Highlighted
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, Pharm and BioPharm Sciences
Highlighted
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);

Highlighted
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

Article Labels

    There are no labels assigned to this post.