Arcpy - append to GDB

394
0
04-29-2020 07:49 AM
PSGeo
by
Occasional Contributor

Dear all,

I am using ArcMap 10.7.

I am appending successfuly features from one GDB to another GDB, after updating two fields in the original gdb. (1) However, I want to change it. 

I want to do the append these features from one GDB to another, and than I want to update the fields of these features in the destination GDB (2). No idea on how to do this. I put the code of the (1) but I need something for the (2)

Anyone can suggest something.

Cheers

P

()
            for fc in fcs:
                count=count_records(fc)   # counts the features within each FC
                if count<>"0":     # only feature classes with features
                    arcpy.AddMessage(fc)
                    print fc
                    with arcpy.da.UpdateCursor(fc,["DATE_1"]) as cur : ## rewrite the date in the field
                        for row in cur:
                            row[0]=date
                            cur.updateRow(row)
                    del row
                    with arcpy.da.UpdateCursor(fc,["PED"]) as cursor_Name:      #update the Issue_Name field in the Feature classes that have features, with the latest date
                        print issue_code
                        for prow in cursor_Name:
                            prow[0]=issue_code
                            cursor_Name.updateRow(prow)
                    del prow
                    targetfc = GDBDwgs + "\\" + fc
                    print targetfc
                    try:
                        arcpy.Append_management(fc,targetfc,"NO_TEST","","" )
                    except:
                        print "something went wrong"
                    del cur
Tags (2)
0 Kudos
0 Replies