FME Form – How to Automate Writer Output Directory and Filename in FME Desktop

fme

I built a workspace in FME Desktop 2017 for re-projecting DWG files between different coordinate systems and I need to automate the writer output folder and filename of the dwg in FME desktop.

I need to compose automatically the writer output path using: 'reader input path/myfolder/reader filename.dwg'

Is there anyway to do this in FME Desktop?

Best Answer

OK, this is quite simple - less than five minutes, which I know because I created a movie demonstrating it:

https://www.screencast.com/t/zdnVYkVGnJEv

To give the steps in more detail here...

1) The source filename information comes from the source dataset parameter (say SourceDataset_ACAD) in the Navigator window

2) Put down a FileNamePartExtractor transformer to break down that source dataset parameter into its component parts, eg dirpath and filename

3) For MyFolder (which I assume the user gets to enter) create a new published/user parameter that lets the user enter a filename.

4) Go to the Navigator window and look for Dataset Fanout for the ACAD output. Turn it on and set the fanout expression to be:

@Value(dirpath)\$(MyFolder)\@Value(filename)

5. Run the translation. Enter a MyFolder value. If the data was originally C:\FMEData2016\Data\Transportation\Roads.dwg, and MyFolder is called "Mark", then the output will be C:\FMEData2016\Data\Transportation\Mark\Roads.dwg

Another thing you could do (for example) is use the TimeStamper transformer to create a timestamp and incorporate that into the file/path name of the output. That way each output is timestamped in its name. Lots of possibilities.