cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

how to get file names or file path

Rock123
Level I
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