Solved

How to make multiple layers export as multiple tabs in a .CSV

  • 28 March 2023
  • 5 replies
  • 19 views

Hi All,

 

I'm very new to FME so excuse my noobiness.

 

I'm bring in a roughly 20 shapefiles and running them through a attribute filter to pull out the ones with a matching project number, from there i'm exporting them out as a .csv.

 

As it currently stands all results are put into one spreadsheet. not ideal. i would like them all in one spreadsheet but as separate tabs for each individual layer. As a work around i've made each layer its own attribute filter running to its own .csv writer, then i'm copying them into a single spreedsheet.

icon

Best answer by egge 28 March 2023, 11:02

View original

5 replies

Userlevel 1
Badge +11

Hi,

Which spreadsheet application are you using? A wild guess would be it is Microsoft Excel you are using, right? If so, you should not write your data to a csv to copy them to your spreadsheet manually. You should be using the Microsoft Excel (XLSXW) Writer. One Excel writer can be used to create multiple tabs (sheets) in a spreadsheet. For Sheet Name you can use the Attribute Value containing the project number. This should give you a single spreadsheet with a tab for each individual project.

Please let us know if this gets your job done.

Cheers,

Egge-Jan

Hi,

Which spreadsheet application are you using? A wild guess would be it is Microsoft Excel you are using, right? If so, you should not write your data to a csv to copy them to your spreadsheet manually. You should be using the Microsoft Excel (XLSXW) Writer. One Excel writer can be used to create multiple tabs (sheets) in a spreadsheet. For Sheet Name you can use the Attribute Value containing the project number. This should give you a single spreadsheet with a tab for each individual project.

Please let us know if this gets your job done.

Cheers,

Egge-Jan

Hi @egge​,

 

Thank you. This has fixed my issue but it has created a new issue. Every tab is getting every attribute column from every layer e.g. i have gravity mains with a column of depths which comes from the manhole attributes. How do i go about fixing this issue?

Userlevel 1
Badge +11

No, you should not see this as a new issue, but as a new challenge instead :-)

I think what you need is a single Excel Writer with multiple Feature Types, one for each sheet you want to create. See screen capture and sample workspace attached.

HTH,

Egge-Jan

Write Data to Multiple Sheets in Spreadsheet

No, you should not see this as a new issue, but as a new challenge instead :-)

I think what you need is a single Excel Writer with multiple Feature Types, one for each sheet you want to create. See screen capture and sample workspace attached.

HTH,

Egge-Jan

Write Data to Multiple Sheets in Spreadsheet

I currently have multiple feature types but when i output it every tab gets every attribute from every feature type. If you look at the excel screenshots you will see in one screenshot im on the sewer service connection tab and it has a column with chainages, then on the next screen shot im on the manholes tab with a column for chainages. There shouldn't be a column for chainages on manholes. This is an issue with all the attributes not just the chainage. see screen shots below. I cant attach the workspace or the spreadsheet for privacy reasons.

imageimage 

Userlevel 1
Badge +11

I think you should design your workspace in such a way that you connect each individual input shapefile to it's own Feature Type in your Excel Writer, without combining/merging the attributes first.

In this way the sewer service connection tab should get only the attributes pertaining to the sewer service connections, and the manhole tab only those from the manholes. Like in the (very simple) sample I showed above...

Reply