Skip to main content

If $(FME_MF_DIR) references "C:/project1/overview/tasks", is there a simple way to reference one directory up, ie: "C:/project1/overview" ? The way I am thinking is to process $(FME_MF_DIR) with some string functions, based on occurrences of the slash - is this the best way forward, or is there is more elegant or simple solution?

Thanks

Hi @makt You could use a ParameterFetcher followed by a FilenamePartExtractor to get one directory up as an attribute.


Hi @makt You could use a ParameterFetcher followed by a FilenamePartExtractor to get one directory up as an attribute.

Thanks Dan,

 

In the meantime, I also figured out another way via PythonCaller using the syntax seen here: https://stackoverflow.com/questions/2860153/how-do-i-get-the-parent-directory-in-python

 

 

 

 


Thanks Dan,

 

In the meantime, I also figured out another way via PythonCaller using the syntax seen here: https://stackoverflow.com/questions/2860153/how-do-i-get-the-parent-directory-in-python

 

 

 

 

@makt A ParameterFetcher shouldn't be necessary. If you want to reference the up directory throughout the workspace then put your Python code into a private Scripted Python Parameter.

 


Reply