Subscribe Bookmark RSS Feed

jmp scripting: How to get directory info for .CSV or .TXT files opened in jmp

hwenchong_gmail

Community Trekker

Joined:

Nov 9, 2015

Jmp script: How to get the directory info for .CSV or .TXT files opened in jmp? when I use "get path", jmp simply shows the file name with .jmp in the end.

Thanks a bunch!

First time posting question here, forgive me if I did not follow the rules well.

2 REPLIES
ms

Super User

Joined:

Jun 23, 2011

I think get path works as expected here: a text file is imported rather than opened and if the resulting JMP data table has not yet been saved, get path will return the table name only.

However, the path of an imported file is stored as JSL in the table property "Source". Unless this has been overwritten by subsequent table operations (e.g. Concatenate or Update) the path can be retrieved from that code.

Example:

dt = Open("$SAMPLE_IMPORT_DATA/Book1.csv");

path = Arg(dt << get property("Source"), 1);

hwenchong_gmail

Community Trekker

Joined:

Nov 9, 2015

Thanks a lot, it works!