expression='getvalue(!parce_test_spatial_join.FLD_ZONE!)' codeblock="def getvalue(string):\n\ valuelist=string.split(',')\n\ valueset=set(valuelist)\n\ value=str(valueset)[5:-2]\n\ value.replace(\"'\",'')\n\ return value"
codeblock="def(string):\n\ value=str(set(string.split(','))).replace(\"'\",'')[5:-2]\n\ return value"
def getvalue(string): valuelist=string.split(',') valueset=set(valuelist) value=str(valueset)[5:-2] value.replace('"','') # not sure what you are trying to replace - a double quote? return value
getvalue(!parce_test_spatial_join.FLD_ZONE!)
import arcpy cur = arcpy.UpdateCursor("parce_test_spatial_join") try: for row in cur: value = row.fld_zone valuelist=string.split(',') valueset=set(valuelist) value=str(valueset)[5:-2] value.replace('"','') row.target_field = value # enter your own field here cur.updateRow(row) del cur except : print "failure on ",value
import arcgisscripting gp=arcgisscripting.create(9.3) gp.MakeFeatureLayer_management("C:/GIS Projects/CRW/TrakIt_Source_RS.gdb/Target_Data/backup_table","parce_test","#","#","A1RENUM A1RENUM VISIBLE NONE;RE_LABEL RE_LABEL VISIBLE NONE;A2OWNAME A2OWNAME VISIBLE NONE;A3MAILADDR A3MAILADDR VISIBLE NONE;A4MAILADDR A4MAILADDR VISIBLE NONE;A5MAILADDR A5MAILADDR VISIBLE NONE;A6MAILCITY A6MAILCITY VISIBLE NONE;A7MAILST A7MAILST VISIBLE NONE;A8MAILZIP A8MAILZIP VISIBLE NONE;A9MAILCTRY A9MAILCTRY VISIBLE NONE;DORAPPCODE DORAPPCODE VISIBLE NONE;DORAPPDESC DORAPPDESC VISIBLE NONE;DTAXDIST DTAXDIST VISIBLE NONE;DEXEMPTS DEXEMPTS VISIBLE NONE;DSITEADDR DSITEADDR VISIBLE NONE;AHSENO AHSENO VISIBLE NONE;AHSENOSUF AHSENOSUF VISIBLE NONE;ASTNAME ASTNAME VISIBLE NONE;ASTMD ASTMD VISIBLE NONE;ASTDIR ASTDIR VISIBLE NONE;ASTUNIT ASTUNIT VISIBLE NONE;DSITEZIP DSITEZIP VISIBLE NONE;DMAPAREA DMAPAREA VISIBLE NONE;DMAPNUM DMAPNUM VISIBLE NONE;DSECTION DSECTION VISIBLE NONE;DTAXACRES DTAXACRES VISIBLE NONE;GISACRES GISACRES VISIBLE NONE;LEGALINE1 LEGALINE1 VISIBLE NONE;LEGALINE2 LEGALINE2 VISIBLE NONE;LEGALINE3 LEGALINE3 VISIBLE NONE;LEGALINE4 LEGALINE4 VISIBLE NONE;LEGALINE5 LEGALINE5 VISIBLE NONE;LEGALINE6 LEGALINE6 VISIBLE NONE;LEGALINE7 LEGALINE7 VISIBLE NONE;LEGALINE8 LEGALINE8 VISIBLE NONE;LEGALINE9 LEGALINE9 VISIBLE NONE;LL1APPTYPE LL1APPTYPE VISIBLE NONE;LL1DEPTH LL1DEPTH VISIBLE NONE;LL1FRONT LL1FRONT VISIBLE NONE;LL1UNITS LL1UNITS VISIBLE NONE;LL1UNITYPE LL1UNITYPE VISIBLE NONE;S1APPTYPE S1APPTYPE VISIBLE NONE;S1AREAHEAT S1AREAHEAT VISIBLE NONE;S1AREATTL S1AREATTL VISIBLE NONE;S1BATHRMS S1BATHRMS VISIBLE NONE;S1BEDRMS S1BEDRMS VISIBLE NONE;S1STORIES S1STORIES VISIBLE NONE;S1UNITS S1UNITS VISIBLE NONE;S1YRBLTACT S1YRBLTACT VISIBLE NONE;S1YRBLTEFF S1YRBLTEFF VISIBLE NONE;SALE1DATE SALE1DATE VISIBLE NONE;SALE1GRNTR SALE1GRNTR VISIBLE NONE;SALE1GRTEE SALE1GRTEE VISIBLE NONE;SALE1INST SALE1INST VISIBLE NONE;SALE1PRADJ SALE1PRADJ VISIBLE NONE;SALE1QU_VI SALE1QU_VI VISIBLE NONE;SALE2DATE SALE2DATE VISIBLE NONE;SALE2GRNTR SALE2GRNTR VISIBLE NONE;SALE2GRTEE SALE2GRTEE VISIBLE NONE;SALE2INST SALE2INST VISIBLE NONE;SALE2PRADJ SALE2PRADJ VISIBLE NONE;SALE2QU_VI SALE2QU_VI VISIBLE NONE;SALE3DATE SALE3DATE VISIBLE NONE;SALE3GRNTR SALE3GRNTR VISIBLE NONE;SALE3GRTEE SALE3GRTEE VISIBLE NONE;SALE3INST SALE3INST VISIBLE NONE;SALE3PRADJ SALE3PRADJ VISIBLE NONE;SALE3QU_VI SALE3QU_VI VISIBLE NONE;VAPBLDG VAPBLDG VISIBLE NONE;VAPFEATXTR VAPFEATXTR VISIBLE NONE;VAPLNDAGR VAPLNDAGR VISIBLE NONE;VAPLNDMRK VAPLNDMRK VISIBLE NONE;VAPTOTAL VAPTOTAL VISIBLE NONE;VASCAPPED VASCAPPED VISIBLE NONE;VASEXEMPT VASEXEMPT VISIBLE NONE;VASJUST VASJUST VISIBLE NONE;VASTAXABLE VASTAXABLE VISIBLE NONE;VASTOTAL VASTOTAL VISIBLE NONE;Flood_zn Flood_zn VISIBLE NONE;Co_FLU Co_FLU VISIBLE NONE;Co_Zoning Co_Zoning VISIBLE NONE;Eco_sys Eco_sys VISIBLE NONE;H_evac H_evac VISIBLE NONE;Elem_zone Elem_zone VISIBLE NONE;Midd_zone Midd_zone VISIBLE NONE;High_zone High_zone VISIBLE NONE;PO_name PO_name VISIBLE NONE;Serv_area Serv_area VISIBLE NONE;Sub_name Sub_name VISIBLE NONE;Sub_blk Sub_blk VISIBLE NONE;Sub_lot Sub_lot VISIBLE NONE;Road_dist Road_dist VISIBLE NONE;Surge Surge VISIBLE NONE;Comm_Dist Comm_Dist VISIBLE NONE;Vote_Prcnct Vote_Prcnct VISIBLE NONE;Fire_Dist Fire_Dist VISIBLE NONE;Shape_Length Shape_Length VISIBLE NONE;Shape_Area Shape_Area VISIBLE NONE") gp.addjoin_management('parce_test', "A1RENUM", r"C:\GIS Projects\CRW\TrakIt_Source_RS.gdb\parce_test_spatial_join", "A1RENUM", "KEEP_ALL") cursor=gp.updatecursor('parce_test') row=cursor.Next() while row: print row.getvalue('[parce_test_spatial_join.FLD_ZONE]') >>> Traceback (most recent call last): File "C:/GIS Projects/CRW/test.py", line 5, in <module> cursor=gp.updatecursor('parce_test') RuntimeError: ERROR 999999: Error executing function.