Skip to main content
Solved

Write file in the same directory where source file is


lukas108
Contributor
Forum|alt.badge.img+7

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?

Best answer by takashi

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.

View original
Did this help you find an answer to your question?

4 replies

takashi
Influencer
  • Best Answer
  • March 3, 2020

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.


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • March 3, 2020

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


redgeographics
Celebrity
Forum|alt.badge.img+50

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.


lukas108
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • March 4, 2020
takashi wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings