Skip to main content
Solved

How to remove empty fields at excel file

  • April 29, 2023
  • 7 replies
  • 150 views

gogopotter90
Contributor
Forum|alt.badge.img+14

Hello ,

i have to write my output from ArcGis sde to excel file .

but I have empty fields at many columns.

i would like to have only fields that have only values .

so how could I remove empty fields ,?

i have read many topics about that but it does not work with me .

could someone provide me with template workspace to remove the empty fields .

Thanks in advance

FME 2021

Best answer by gazza

Is this closer?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • 132 replies
  • April 30, 2023

The attached workspace (2023.0 beta) creates some features which have two attributes that are blank. It uses the AttributeValueLengthExposer transformer from FME Hub to detect those two and creates a regex attribute containing those names which is used by a BulkAttributeRemover to remove them.

The a SchemaScanner is used to get the new schema without those attributes and an excel writer in Dynamic mode is used to create the output file which only has columns that have values.

 

Hope that helps.


gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • 132 replies
  • April 30, 2023

The attached workspace (2023.0 beta) creates some features which have two attributes that are blank. It uses the AttributeValueLengthExposer transformer from FME Hub to detect those two and creates a regex attribute containing those names which is used by a BulkAttributeRemover to remove them.

The a SchemaScanner is used to get the new schema without those attributes and an excel writer in Dynamic mode is used to create the output file which only has columns that have values.

 

Hope that helps.

I think the attribute removers aren't actually needed, the SchemaScanner could probably ignore them by using the regex.


gogopotter90
Contributor
Forum|alt.badge.img+14
  • Author
  • Contributor
  • 239 replies
  • April 30, 2023

The attached workspace (2023.0 beta) creates some features which have two attributes that are blank. It uses the AttributeValueLengthExposer transformer from FME Hub to detect those two and creates a regex attribute containing those names which is used by a BulkAttributeRemover to remove them.

The a SchemaScanner is used to get the new schema without those attributes and an excel writer in Dynamic mode is used to create the output file which only has columns that have values.

 

Hope that helps.

Thanks a lot

but the aggregator in new version so I am not sure which parameter inside it ,could u provide parameter for only aggregator because I have Fme 2021 ,so it does not appear.

i have noticed in ur input that the column attribute 5 and other attribute have total empty fields .

but what will happen if attribute 5 has 5 fields ( 3 fields have a value and has 2 empty fields at the same column )

input as example

index Attribute 5 Attribute 6

1 ddd Kkkk

2 Ccc Missing

3 Missing llll

4 Missing Missing

5 aaa ggg

6 bbbb Missing

 

result that I want

index. Attribute 5 Attribute 6

1 ddd Kkkk

2 Ccc llll

3 aaa ggg

4 bbbb

i have actually around 100 attributes name

 

could u add solution to get this result also .thanks for help

 


gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • 132 replies
  • April 30, 2023

Thanks a lot

but the aggregator in new version so I am not sure which parameter inside it ,could u provide parameter for only aggregator because I have Fme 2021 ,so it does not appear.

i have noticed in ur input that the column attribute 5 and other attribute have total empty fields .

but what will happen if attribute 5 has 5 fields ( 3 fields have a value and has 2 empty fields at the same column )

input as example

index Attribute 5 Attribute 6

1 ddd Kkkk

2 Ccc Missing

3 Missing llll

4 Missing Missing

5 aaa ggg

6 bbbb Missing

 

result that I want

index. Attribute 5 Attribute 6

1 ddd Kkkk

2 Ccc llll

3 aaa ggg

4 bbbb

i have actually around 100 attributes name

 

could u add solution to get this result also .thanks for help

 

Here's a version for 2021.2.


gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • 132 replies
  • April 30, 2023

Thanks for the clarification about what you want. My workspace was only removing attributes if there are no values for them at all. What you want requires moving attributes to different records. I think I have an idea how to do it so stand by.


gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • 132 replies
  • Best Answer
  • April 30, 2023

Is this closer?


gogopotter90
Contributor
Forum|alt.badge.img+14
  • Author
  • Contributor
  • 239 replies
  • May 1, 2023

Is this closer?

Thanks a lot