I need to iterate through a file GDB feature classes to replace values found in all the columns of attribute tables with the blank ones (empty'').
Here is my code, that doesn't work. Truth be told I'm not familiar with programming languages, but couldn't implement this task in ModelBuilder, that is why it seems the only way. What's wrong with it?
import arcpy
fc = "C:\Users\Vadim\Downloads\GML\MolokovGP_p10.gdb"
fieldList = arcpy.ListFields(fc, field_type="integer")
fieldObs = arcpy.ListFields (fc)
fieldNames = []
for field in fieldObs:
fieldNames.append(field.name)
del fieldObs
fieldCount = len(fieldNames)
with arcpy.da.UpdateCursor(fc, fieldNames) as curU:
for row in curU:
rowU = row
for field in range(fieldCount):
if rowU[field] == None:
rowU[field] = replacementValue
curU.updateRow(rowU)
This error occurs:
Runtime error
Traceback (most recent call last):
File "<string>", line 4, in <module>
File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\__init__.py", line 1131, in ListFields
return gp.listFields(dataset, wild_card, field_type)
File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\geoprocessing\_base.py", line 344, in listFields
self._gp.ListFields(*gp_fixargs(args, True)))
RuntimeError: ERROR 999999: Error executing function.