Skip to main content
Solved

Looping Through Fields

  • March 28, 2013
  • 4 replies
  • 24 views

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
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.

4 replies

fmelizard
Safer
Forum|alt.badge.img+21
  • Safer
  • March 28, 2013
Hi,

 

 

The nullattributereplacer would be the first I would try.

 

hope this helps

david_r
Celebrity
  • 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.