从文件目录中提取文件夹名称如何从文件目录中提取文件夹名称? 保存时我会使用文件夹的名称作为数据表的名称。 我正在使用 JMP 15。
我尝试了在这里看到的这段代码,但仍然无法提取文件夹名称。 我
Dir = "";
p = pick Directory("Select a Folder", Dir);
f = Files In Directory(p);
Dir = Substr( p, 1, Length( p ) - Length( Word( -1, p, "\/" ) ) - 1 );前任。
文件路径:C:\Users\Animals
目录=动物
自动化和脚本编写回复:从文件目录中提取文件夹名称这应该返回 Animals(至少 JMP17 是这样)
Names Default To Here(1);
dir = "C:\Users\Animals";
foldername = Word(-1, dir, "\");
show(foldername); // foldername = "Animals";
回复:从文件目录中提取文件夹名称链接到(其中之一)原始帖子:
https://community.jmp.com/t5/Discussions/extracting-the-directory-of-a-jmp-file-in-JSL/mp/423133/highlight/true#M67228
xx="C:\temp\myfile.txt";
theDirectory = Substr( xx, 1, Length( xx ) - Length( Word( -1, xx, "\/" ) ) - 1 );<BR /><BR />//"C:\temp"