Skip to main content
Solved

How to remove empty fields at excel file


gogopotter90
Contributor
Forum|alt.badge.img+13

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?

View original
Did this help you find an answer to your question?

7 replies

gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • 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
  • April 30, 2023
gazza wrote:

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+13
  • Author
  • Contributor
  • April 30, 2023
gazza wrote:

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
  • April 30, 2023
gogopotter90 wrote:

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
  • 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
  • Best Answer
  • April 30, 2023

Is this closer?


gogopotter90
Contributor
Forum|alt.badge.img+13
  • Author
  • Contributor
  • May 1, 2023
gazza wrote:

Is this closer?

Thanks a lot


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