Question

Multiple output file names

  • 16 November 2015
  • 7 replies
  • 14 views

Badge
Hello,

 

I want to create a large number (100) of files with different filenames, depending on the name or attributes of the input files.

 

 

In detail, I have one Reader, reading 100 XML-Files, processing them (extracting different attributes etc.), and I want to write the contents to 100 text-files, but each text-file should be named after one (different) attribute.

 

 

Since User Parameters are not changeable through runtime and I have no Idea how to use attributes as parameterized filenames, I am stuck with this problem.

 

 

Is there a way to achieve that? Thanks.

 

 

(FME 2015 1.2.1 Win32)

 

 

Best Regards,

 

Ron

 

 

 


7 replies

Badge +2
Hi Ron,

 

 

Please try Fanout option in Advanced settings of txt writer

 

 

Pratap
Badge
Hello,

 

 

thanks for the quick answer.

 

 

I have read about the fanout option, but my workbench only offers to activate it (with no additional options) and crashes with an error:

 

 

"[..] Writer: Template file '[..]' and Destination dataset '\\0' do not have the same extension."

 

 

Which makes no sense to me because all files have the same extension.

 

 

 

Best Regards,

 

Ron

 

Badge +2
Hi,

 

 

Extension can be same but file name should be unique...

 

 

Add counter and concatenate with your filename attribute to get unique filename.

 

 

If still it is not solved, please send the screenshot of the fanout settings of writer...

 

 

Pratap
Badge
Hello,

 

I have broken down the problem to one single input file, trying to name the output file after the input file. It's still not working. How can I parameterize the filename? It's not working with attributes etc.

 

 

Best Regards,

 

Ron

 

Badge +2
Hi,

 

 

Seems you are using xls writer istead of txt writer.

 

 

Please see the advanced settings (at highlighted) of txt reader.

 

I don't have FME 2015 to review but I have made work space in FME 2014. Kindly review

 

 

Pratap

 

 

Badge
Hello,

 

ah yes, that was what I was looking for :)

 

 

Thank you very much.

 

 

(it's well hidden...)

 

 

Best Regards,

 

Ron

 

Userlevel 4
Badge +13
Hello,

 

ah yes, that was what I was looking for :)

 

 

Thank you very much.

 

 

(it's well hidden...)

 

 

Best Regards,

 

Ron

 

(Yes, in FME 2015 and older the fanout on dataset was hidden fairly deeply. In FME 2016 we've made it more 'in your face'. FME should be able to solve your problem with fanout -- trust it is all working now).

Check out this article for more background on fanout https://knowledge.safe.com/articles/565/fanout-1.html as well.

Reply