Question

How do I tell FME to send the full path as a string and NOT $(FME_MF_DIR)?

  • 19 April 2017
  • 1 reply
  • 4 views

Badge +4

Hello,

I have this problem when trying to open a directory with a python parameter.

The line in my script causing the error:

f=open(os.path.join(FME_MacroValues['path_orders'],ftp.nlst()[0]),'w')

IOError: No such file or directory: '$(FME_MF_DIR)orders\\\\1234567.WI02290100.vg'

How do I tell FME to send the full path as a string and NOT $(FME_MF_DIR)?


1 reply

Badge +4
I Solved this by accessing the same dictionary FME_MacroValues['FME_MF_DIR']

 

 

path = FME_MacroValues['path_orders']

 

if re.search('\\$\\(',path):

 

_path = path.split('(')[1].split(')')[0]

 

_path_rest = path.split(')')[1]

 

path = os.path.join(FME_MacroValues[_path],_path_rest)

 

 

Reply