I have three writers (CSV, Shape, MITAB) that I want to output to the same directory.
However, I want that directory to be specified within the workspace at runtime based on the fme_basename of the input.
So for example:
Inputs:
random_dataset_1.csv
random_dataset_2.xls
Outputs:
c:\\outputs\\random_dataset_1\\bad_data.shp
c:\\outputs\\random_dataset_1\\bad_data.TAB
c:\\outputs\\random_dataset_1\\bad_data.csv
c:\\outputs\\random_dataset_2\\bad_data.shp
c:\\outputs\\random_dataset_2\\bad_data.TAB
c:\\outputs\\random_dataset_2\\bad_data.csv
How can I do this? There isn't a "parameterWriter". I think I saw someone about using special fme_ attributes, but I can't recall what nor find them.
Thanks.
Best answer by david_r
Hi again,
please note that there is an important distinction between Attribute and Dataset fanout.
Concerning the differences between file and directory based datasets, you will have to create two different fanout values depending on this type.
Here is a quick example I made that shows how to use fanout dataset to push shapefiles to different directories depending on an input attribute:
(scroll to the right to see all of it)
It is a very flexible solution that adapts well to most scenarios with a little bit of creativity :-) Hopefully you get the idea.
David
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
take a look at Dataset Fanout, it will split your output based on an attribute. You could either use fme_basename or use any other attribute that you create yourself.
CSV is file based, the other two are directory based.
Thus I'd prefer to explicitly set the directory once and all three could use it. I just don't know how to pass a directory to an output as an attribute.
Although that page doesn't actually say how to do dataset fanouts, so I can't test it anyway (seems like quite an omission). But I'm fairly sure its not what I want.
David - I've somehow always managed to miss the "fanout" option in advanced (despite seeing it plenty of times). That did the trick. Didn't actually need the String Concatenator - that just broke things.