I would like to set the folder name of the source file to a published parameter, so I can use the folder name in the output directory filepath.
I have found in another post, the following TCL script for returning a filepath:
return efile dirname $FME_MacroValues(SourceDataset_SHAPE)]
Can someone please tell me how to amend this script so that it returns only the folder name not the whole directory? Or if the TCL option is not possible, any other ideas on using the folder name in the output file path?
(btw, I manage to extract the folder name within the workbench and set it to a published parameter, but the workbench still asks me for the published parameter when I run it, so it isn't working. I'm assuming this is because the output directory needs to be set at the start of the workbench so because I set the published parameter within the workbench it is too late).
Thanks,