Question

Multiple shape files to Multiple Excel sheets

  • 14 October 2019
  • 4 replies
  • 4 views

Badge

Hello,

I need help in addressing multiple shapefiles in .zip , add some transformers to it and then write it to an excel file with different shapefiles result copying in different sheets in the same excel.

Thanks in advance.

Mukhtar


4 replies

Userlevel 4
Badge +25

It's a very generic question so hard for us to give you a detailed answer.

You can use the fme_feature_type attribute (containing the shapefile name) to fill the Excel sheet name, that should take care of most of it. If you don't know beforehand which shapefiles will be present in the zip file you can set a merge filter on the input feature type and make it more dynamic that way.

If you can elaborate more, or give us some sample data, I'm sure we can assist you better.

Badge

It's a very generic question so hard for us to give you a detailed answer.

You can use the fme_feature_type attribute (containing the shapefile name) to fill the Excel sheet name, that should take care of most of it. If you don't know beforehand which shapefiles will be present in the zip file you can set a merge filter on the input feature type and make it more dynamic that way.

If you can elaborate more, or give us some sample data, I'm sure we can assist you better.

Hi @redgeographics , let me give an example. I have a zip file of 2 shapefiles. To that, I want to add transformers and get the pivoted results in fme and then write the result of two shapefile in two different sheets respectively with their names populated as sheet names. I need a loop that can work on the first shapefile .Generate the result in the 1st sheet then work on the second shapefile and then generate its result in the 2nd sheet of the same excel. Can workspace runner be used or any batch mode available?

Userlevel 4
Badge +25

Hi @redgeographics , let me give an example. I have a zip file of 2 shapefiles. To that, I want to add transformers and get the pivoted results in fme and then write the result of two shapefile in two different sheets respectively with their names populated as sheet names. I need a loop that can work on the first shapefile .Generate the result in the 1st sheet then work on the second shapefile and then generate its result in the 2nd sheet of the same excel. Can workspace runner be used or any batch mode available?

Is there any reason why you want to process them separately? If not, stuff like looping or WorkspaceRunners is probably not necessary and the basic process I outlined should work.

Badge +2

@mukhtar_gf I think you're looking for a dynamic workflow as described in this tutorial: Tutorial: Dynamic Workflows . When you add the Shape reader you can use Single Merged Feature Type. When you add the Excel writer use the Dynamic Feature type. This will give you a very simple workspace similar to the one attached. You can then add the pivot. Example workspace (2019.0) esrishape2xlsxw.fmwt

Reply