j_mata

How to create a syntax that will replace the same values in different fields

Discussion created by j_mata on Jun 29, 2013
Latest reply on Jul 1, 2013 by rzufelt
Hi,

I am not familiar with Python programming and would appreciate your assitance.

Basically, I have an attribute table of more than 150,000 records and several fields. In 6 of the fields I need to replace a code (or recode) some values for something else. If I use the field calculator I will have to go through each of those fields and would be too cumbersome and tedious. I have the feeling that there is a way to do this simultaneously for all fields but I am not sure how to create the syntax.  I have a few failed trials of comin up with that syntax based on what I have been reading on internet but I am missing something. Any thoughts?

Thanks

Jay

>>> import arcpy
... import os
...
...  !RUseCode02!.replace("999", "9999"), !RUseCode03!.replace("999", "9999"),!RUseCode04!.replace("999", "9999"),
run

Outcomes