Select to view content in your preferred language

Set Null Values to Target Tool

3210
2
08-21-2015 09:33 AM

Set Null Values to Target Tool

Hi All,


I made a quick scripting tool that I thought I would share. The scripting tool will take a feature class, its fields, and a new target value as inputs. Where ever a Null value exists (None), the value will be set to the target value. The target value default is of numeric type and is set to 0.

This tool has to be used understanding what your field types are, the tool will try and set the target field to the desired value with an update cursor, but will pass that row if it cannot. Only "None" values are changed, all other values should be left alone.

It is really simple, but might be helpful. I am not sure something like this exists (I know it does for raster but not for fields). You could accomplish the same with a "calculate field", but this allows multiple fields if you need it for a lot of fields.

David

Attachments
Comments
LeileiDuan1
Occasional Contributor

It's the kind of tool that you don't usually think about but will become very useful and time saving when needed. Good job David!

DavidWasserman
Frequent Contributor

It really is. It is not very glorious at all. haha.

Version history
Last update:
‎08-21-2015 09:33 AM
Updated by:
Contributors