Skip to main content
Question

Multiple output file names

  • November 16, 2015
  • 7 replies
  • 54 views

Forum|alt.badge.img
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

pratap
Contributor
Forum|alt.badge.img+11
  • Contributor
  • November 16, 2015
Hi Ron,

 

 

Please try Fanout option in Advanced settings of txt writer

 

 

Pratap

Forum|alt.badge.img
  • Author
  • November 16, 2015
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

 


pratap
Contributor
Forum|alt.badge.img+11
  • Contributor
  • November 16, 2015
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

Forum|alt.badge.img
  • Author
  • November 16, 2015
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

 


pratap
Contributor
Forum|alt.badge.img+11
  • Contributor
  • November 16, 2015
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

 

 


Forum|alt.badge.img
  • Author
  • November 16, 2015
Hello,

 

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

 

 

Thank you very much.

 

 

(it's well hidden...)

 

 

Best Regards,

 

Ron

 


fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • November 16, 2015
ronk wrote:
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.


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