Using Actual NULL Values
Shapefiles cannot handle NULL values so copy the feature class to a file geodatabase. Then in the new copied fGDB feature class, view the attribute table, and right-click on the field heading and choose 'Field Calculator`.
In the Field Calculator options, set the options as per below (replacing 'fieldName' with the actual name of the field):
Parser: 'Python'
Show Codeblock: ON
Pre-Logic Script Code (appears after setting 'Show Codeblock' ON above):
def calc(value):
if value == -9999:
return None
return value
fieldName = : calc(!fieldName!)
Click OK.
(Note that None is the Python way of specifying the NULL value.)
Alternatively, you can first select only the records with the -9999 values, and then in the Field Calculator just select 'Python' and enter the expression as None. In some ways, this The Field Calculator will only run on the selected records (if there are any selected). This is simpler to implement. But I prefer but my personal preference is to use the method described above, as it keepshas all the logic in one single too/dialogueplace.
Using Another Value Instead of NULL
If you don't explicitly need NULL but some other value will do (eg, and empty string, '', or 0), then you don't need to copy to a fGDB first. But I'd still recommending using a copy of the data (eg copy to a new shapefile) to avoid corrupting your original data. In this case, use the Field Calculator as above, but, replace return None with return ''.