Skip to main content

I am trying to use the FilenameExtractor to get the rootname of the source file to match the new filename in a different source directory with a different format i.e. my pipeline is essentially

MyFileName.xlsx → MyFileName.json

Currently if I use the source filename input paramter the behavior is like:

MyFileName.xlsx → MyFileName.xlsx.json , which I don’t want.

I tried using the FileNameExtractor where _rootname gets set as a user paramet but then the output is like:

MyFileName.xlsx → _rootname.json 

The value of the user parameter does not actually extract the rootname and save its value as the user parameter dynamically. Can anyone help?

edit:

Scripted Python (safe.com)

I used a scripted parameter at the start of the workspace but still curious as to why the filename extractor did not perform as expected?

I might not be quite understanding the problem here, but there are two pretty straight forward ways to pull the source filename and then suffix and prefix it.

  1. Pull the parameter being used by the reader then extracting the rootname and updating it
  2. Exposing the fme_basename attribute on the reader and then updating that

 

 


Reply