Rename data table from a subsection of the file path.I use Pick File() to retrieve the file path. From this file path I want to take a subsection and use this as the name for the data table produced by the script.
For example the file path is C:\Documents\Plot_Losses\DUT2\25C\filename and I want to call the data table 25C.
I can use Set Name to name the data table as the whole file path but not a subsection.
How can I script this for when the temperature folder changes the name of the data table changes too.
Automation and ScriptingContent OrganizationData Blending and CleanupRe: Rename data table from a subsection of the file path.Which part do you want to use? Is it always the folder name before filename?
Re: Rename data table from a subsection of the file path.Yes its always the folder before the filename
Re: Rename data table from a subsection of the file path.Then you can most likely use Word() with -2 as the index (searches from the end) (-1 would be the filename)
Names Default To Here(1);
filepath = "C:\Documents\Plot_Losses\DUT2\25C\filename.jmp";
foldername = Word(-2, filepath, "\");
show(foldername); // foldername = "25C";
Re: Rename data table from a subsection of the file path.This works great, thank you