Skip to main content
Solved

Output grouping


fmelizard
Safer
Forum|alt.badge.img+19
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
View original
Did this help you find an answer to your question?
<strong>This post is closed to further activity.</strong><br /> It may be a question with a best answer, an implemented idea, or just a post needing no comment.<br /> If you have a follow-up or related question, please <a href="https://community.safe.com/topic/new">post a new question or idea</a>.<br /> If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

david_r
Celebrity
  • April 30, 2013
Hi jonathan,

 

 

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.

 

 

David

fmelizard
Safer
Forum|alt.badge.img+19
  • Author
  • Safer
  • April 30, 2013
Thanks David,

 

I already know about "fanout by attribute" but that doesn't do it.

 

 

I already know about them but I'm afraid that won't do it because File and Directory features get treated differently

 

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_r
Celebrity
  • Best Answer
  • April 30, 2013
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

fmelizard
Safer
Forum|alt.badge.img+19
  • Author
  • Safer
  • April 30, 2013
Hi,

 

 

Maybe the filename part extractor might help you to produce the value on which to fan out.

 

Hope this helps

fmelizard
Safer
Forum|alt.badge.img+19
  • Author
  • Safer
  • April 30, 2013
Thanks Both.

 

 

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.

 

 

Set the "Fanout Directory" to

 

c:\\outputs\\

 

 

"attribute to fanout" to a _feature_type

 

That did it fine.

 

Cheers!

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