Solved

Write file in the same directory where source file is

  • 3 March 2020
  • 4 replies
  • 13 views

Badge +5

Hello, I need to write the resulting file to the same directory where my source file is, no matter where is the workspace. However, variables cannot be inserted into the writer's destination directory. Can anyone help?

icon

Best answer by takashi 3 March 2020, 14:01

View original

4 replies

Userlevel 2
Badge +17

Hi @lukas108, a possible way is to use the FetureWriter to write the destination dataset. You can set an attribute (or a string expression) to the Dataset parameter (i.e. the destination deirectory) in the FeatureWriter.

Userlevel 1
Badge +10

Another way to do this is to use a python scripted parameter to set the writer location

Userlevel 5
Badge +25

As a general note: make sure you don't try and overwrite your source file (been there myself...), be very careful about filenames because FME will happily overwrite existing files without warning and if that's the source file while it's also reading it at the same time it ends up corrupting the file.

Badge +5

Hi @lukas108, a possible way is to use the FetureWriter to write the destination dataset. You can set an attribute (or a string expression) to the Dataset parameter (i.e. the destination deirectory) in the FeatureWriter.

That´s it. Thank you.

Reply