Solved

How to reference parent directory of $(FME_MF_DIR)?

  • 12 April 2018
  • 3 replies
  • 11 views

Badge

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

icon

Best answer by fmelizard 12 April 2018, 22:57

View original

3 replies

Userlevel 4
Badge +13

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

Badge

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

 

 

 

 

Userlevel 4
Badge +13
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