cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • 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
vibhu7668
Level I

Storing folder directory from user prompted file selection

This code not working. Please suggest how to modify it

 

file_name = Pick File ( "Select a file to open" ); // this line of code is working
folder_path = file_name << Get Directory() ; // this line of code not working.

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Storing folder directory from user prompted file selection

try


folder_path = substr(file_name, 1, length( file_name)- 
	length(word(-1,file_name,"\/")))
Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Storing folder directory from user prompted file selection

try


folder_path = substr(file_name, 1, length( file_name)- 
	length(word(-1,file_name,"\/")))
Jim
vibhu7668
Level I

Re: Storing folder directory from user prompted file selection

That worked.

 

Thanks.

jthi
Super User

Re: Storing folder directory from user prompted file selection

I like doing this using Word() with matrix to define the range of return (Word supports negative index)

Names Default To Here(1);

filepath = Convert File Path("$SAMPLE_DATA/Big Class.jmp", windows);

directory = Word([1 -2], filepath, "/\") || "\";

Show(filepath, directory);

If you don't need to have "/" or "\" at the end of your folder path, you can drop the || "\" part.

-Jarmo

Recommended Articles