Skip to main content
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
Hi,

 

 

The nullattributereplacer would be the first I would try.

 

hope this helps
Hi Alan,

 

 

have you tried the NullAttributeRemover from the FME Store?

 

 

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

Reply