cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

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

how to get file names or file path

file1 = pick file();
file_name = ...
suff = word(-1, file_name, ".")
if(suff == "txt" | file_name == “csv”, 
	open(file1), ....
);

how can i get file_name when I pick up a file?  

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: how to get file names or file path

Variable "file1" contains the path.

The filename can easily be extracted with

file_name = Word( -1, file1, "/" );

 

Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: how to get file names or file path

Variable "file1" contains the path.

The filename can easily be extracted with

file_name = Word( -1, file1, "/" );

 

Jim
Rock123
Level I

Re: how to get file names or file path

I am feeling so exited to have your reply!

Rock123
Level I

Re: how to get file names or file path

If I like to get the path of file1, what shall I do? 

txnelson
Super User

Re: how to get file names or file path

I think this is what you really want

file1 = pick file();
file_name = Word( -1, file1, "/" );
suff = word(-1, file_name, ".")
if(suff == "txt" | stuff == “csv”, 
	open(file1); 
);
Jim

Recommended Articles