7

With FME Desktop I'd like to write a text file with a dynamic filename, consisting of the date of today and a guid. I know how to create both parameters (date and guid), but I don't understand how to integrate it into to filename, e.g. 2020-09-02_ABCDEFG123id.txt

The problem about it is that only feature type names can be created dynamically. But the filename has to be chosen when adding the writer, so it cannot be changed depending on the input data. I tried the TXT-, the XML- and the Generic-writer.

enter image description here

6

In the Navigator panel, find the Writer you want to change and edit the parameter "Destination Text File". Then you can edit the filename based on attribute value.

Navigator window.

Edit parameter.

Even better, stop using classic Writers, use a FeatureWriter instead. Open the FeatureWriter and edit "Dataset:", which is more intuitive.

FeatureWriter Parameters

1
  • Your first suggestion by editing in the navigator didn't work for me, because there in the text Editor I can only choose workspace parameters but no attribute values (FME Desktop 2020). But: your second suggestion, the feature writer, worked perfectly. Thanks!!
    – Maja Ott
    Sep 2 '20 at 14:22
6

As noted in the other answer, you can do this with a FeatureWriter transformer.

But as an fyi, if you do want to do this in a standard writer, you would use the Fanout option. As you noted, you can't put an attribute into the Destination File name. But if you check the option for a Dataset Fanout, then you can put the information into there.

Here are some screenshots. The first embeds the datetime function into the Fanout Expression. The second uses an attribute. But see this item on the FME Community for the full info.

enter image description here

enter image description here

1
  • 1
    Thanks a lot for this additional explanation, thats very helpful.
    – Maja Ott
    Sep 3 '20 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.