Skip to main content
Question

Automatic File Names

  • 10 July 2024
  • 5 replies
  • 59 views

Hello,

I am new to FME but have some overall experience with coding and I know there has to be a simple way to solve the issue of automatically creating the file name based on an attribute. I am trying to create an excel file with multiple sheets and I have tried using the fan out parameter (along with anything else I can find online) but its been making multiple files or crashing, instead of just one file with multiple sheets. I have been researching this issue for far too long with absolutely no head way so any help will be greatly appreciated. I will also need to create a kmz/kml file with the same naming parameters if that changes anything.

Thank you in advance,

Sam

5 replies

Userlevel 5
Badge +32

to change the sheet name you will need to set it in the Feature Type parameters of the output feature type. Here’s a screen shot below. The Fanout will create multiple files, this method will create multiple sheets. 

 

 

Badge +41

In my experience the FeatureWriter is a more intuitive way to configure fanouts than classic Writers. When we train a new teammember in FME, the first thing they learn is to let the classic Readers and Writers be and use FeatureReaders and FeatureWriters instead.

Badge +1

to change the sheet name you will need to set it in the Feature Type parameters of the output feature type. Here’s a screen shot below. The Fanout will create multiple files, this method will create multiple sheets. 

 

 

Thank you for the quick response. I’m sorry, I see now that my question was not very clear. I am trying to create a variable file path that the excel book is saved to based off of some predetermined data.

For example; I have a sheet that assigns job IDs to groups, then there is a filter that I have to manually choose the group to process and also assign the file path which is always based off of the group chosen and the date. The next part of the project is to loop through all of the groups but baby steps first.

Badge +24

The FeatureReader is more intuitive:

 

Userlevel 6
Badge +26

to change the sheet name you will need to set it in the Feature Type parameters of the output feature type. Here’s a screen shot below. The Fanout will create multiple files, this method will create multiple sheets. 

 

 

Thank you for the quick response. I’m sorry, I see now that my question was not very clear. I am trying to create a variable file path that the excel book is saved to based off of some predetermined data.

For example; I have a sheet that assigns job IDs to groups, then there is a filter that I have to manually choose the group to process and also assign the file path which is always based off of the group chosen and the date. The next part of the project is to loop through all of the groups but baby steps first.

@sbertrand Are you saying that you want ONE xlsx file with ONE sheet written out to different folders based on the data that is contained within the xlsx file and sheet? So if the data has values of A, B, and C. You would get 3 folders (A folder, B folder, and C folder) each with one xlsx file and one sheet that contain just the A, B or C data respectively.

Reply