Skip to main content
Solved

Looping Through Fields


Forum|alt.badge.img
Hello FMErs,

 

I have a dataset with a large number of attributes I want to write to KML.  Since most of the fields for any one record will be empty I'd like to check each field of each record and remove the field if it does not contain data.  The search criteria for each field are the same so I'd like to loop the attributes from an array of some sort.

 

I've looked at lists and looping in custom transformers but I can't quite see a path.

 

Any suggestions would be greatly appreciated,

 

Alan

Best answer by david_r

Hi Alan,

 

 

have you tried the NullAttributeRemover from the FME Store?

 

 

David
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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.

4 replies

fmelizard
Contributor
Forum|alt.badge.img+17
  • Contributor
  • March 28, 2013
Hi,

 

 

The nullattributereplacer would be the first I would try.

 

hope this helps

david_r
Evangelist
  • Best Answer
  • March 29, 2013
Hi Alan,

 

 

have you tried the NullAttributeRemover from the FME Store?

 

 

David

Forum|alt.badge.img
  • Author
  • March 29, 2013
Gentlemen,

 

 

Thank you both for the tips. 

 

 

Unfortunately the nullattributereplacer will only insert a value into an otherwise null attribute.  It won't remove the attribute entirely.

 

 

 

The  NullAttributeRemover will remove the attributes but many of my fields contain a value for "NULL" such as -999999.  Those it will not remove.  I'll see if I can further customize it to look for and remove such values.

 

 

Again, thanks to you both,

 

Alan

Forum|alt.badge.img
  • Author
  • March 29, 2013
Quick update: It was very easy to customize the NullAttributeRemover to handle all the cases I have.  I just edited the PythonCaller's Python script to include what I needed in it's if statement.  Far easier than I imagined.  Many thanks.

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