cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
MedianRooster10
Level III

Rename data table from a subsection of the file path.

I use Pick File() to retrieve the file path. From this file path I want to take a subsection and use this as the name for the data table produced by the script.

For example the file path is C:\Documents\Plot_Losses\DUT2\25C\filename and I want to call the data table 25C. 

 

I can use Set Name to name the data table as the whole file path but not a subsection.

How can I script this for when the temperature folder changes the name of the data table changes too.

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Rename data table from a subsection of the file path.

Then you can most likely use Word() with -2 as the index (searches from the end) (-1 would be the filename)

Names Default To Here(1);

filepath = "C:\Documents\Plot_Losses\DUT2\25C\filename.jmp";
foldername = Word(-2, filepath, "\");
show(foldername); // foldername = "25C";
-Jarmo

View solution in original post

4 REPLIES 4
jthi
Super User

Re: Rename data table from a subsection of the file path.

Which part do you want to use? Is it always the folder name before filename?

-Jarmo
MedianRooster10
Level III

Re: Rename data table from a subsection of the file path.

Yes its always the folder before the filename

jthi
Super User

Re: Rename data table from a subsection of the file path.

Then you can most likely use Word() with -2 as the index (searches from the end) (-1 would be the filename)

Names Default To Here(1);

filepath = "C:\Documents\Plot_Losses\DUT2\25C\filename.jmp";
foldername = Word(-2, filepath, "\");
show(foldername); // foldername = "25C";
-Jarmo
MedianRooster10
Level III

Re: Rename data table from a subsection of the file path.

This works great, thank you

Recommended Articles