Add File Name and Date in Import SettingsI would like some input on how to include adding File Name and File Date in import settings.
In typical Multiple File Import, we have
<<SET add="" file="" name="" column=""></SET>
However, this will not work in my case. So I tried using New Column () function, but it gives empty columns or no column "Source File" at all.
For(i = 1, i <= N Items(selectedPaths), i++,
path = selectedPaths[i];
dt = Open(
path,
Headers(1),
Column Names Start(1),
Data Starts(2),
End Of Field(","),
Invisible
);
dt << New Column("Source File",
Character,
Set Values(Repeat(path, N Rows(dt)))
);
I guess it should be included amongst dt = Open () setting but I do not know what to put there for File Name and File Date Columns.
Automation and ScriptingRe: Add File Name and Date in Import SettingsIs there a specific reason why Multiple File Import cannot be used? You can find syntax for Open() from JSL Syntax reference Open(path, ) or from scripting guide but I would suggest you do it once manually from JMP using the interactive open and then copy+modify the script JMP provides you with.
Re: Add File Name and Date in Import SettingsA couple of comments
Using your JSL, you can change your code very simply to add in the Path
dt << New Column("Source File",
Character,
Set Each Value(path)
);
Also, if you use the Modal option on your New Windows you do not have to use your "Done" methodology. Modal windows stop the processing beyond the New Window, until the window is closed
Names Default To Here(1);
// Step 1: Prompt user to choose between File or Folder
uploadType = "";
done = 0;
nw = New Window("Select Upload Type",modal,
Panel Box("Choose Upload Type",
cb = Combo Box({"File", "Folder"}),
Button Box("OK",
uploadType = cb << Get Selected;;
)
)
);