extract the folder name from file directory
How can I extract the folder name from file directory? I will use the folder's name as the name of the data table when saving it. I am using JMP 15.I tried this piece of code I saw here but still cannot extract the folder name. I Dir = "";
p = pick Directory("Select a Folder", Dir);
f = Files In Directory(p);
Dir = Substr( p, 1, Length( p ) - Length( Word( -1, p, "\/" ) ) - 1 );
Ex. File path: C:...