import arcpy featureClass = arcpy.GetParameterAsText(0) cur = arcpy.UpdateCursor(featureClass) for row in cur: subtypeValue = row.SUBTYPE subtypeValueIndex = subtypeValue.split(" ") row.SUBTYPE = subtypeValueIndex[0] materialValue = row.STRMAT strmatValueIndex = materialValue.split("-") row.STRMAT = strmatValueIndex[0] photoynValue = row.PHOTOYN photoynValueIndex = photoynValue.split("-") row.PHOTOYN = photoynValueIndex[0] conditionValue = row.CONDITION conditionValueIndex = conditionValue.split("-") row.CONDITION = conditionValueIndex[0] clidmatValue = row.CLIDMAT clidmatValueIndex = clidmatValue.split("-") row.CLIDMAT = clidmatValueIndex[0] accesstypeValue = row.ACCESSTYPE accesstypeValueIndex = accesstypeValue.split("-") row.ACCESSTYPE = accesstypeValueIndex[0] groundtypeValue = row.GROUNDTYPE groundtypeValueIndex = groundtypeValue.split("-") row.GROUNDTYPE = groundtypeValueIndex[0] stepsValue = row.STEPS stepsValueIndex = stepsValue.split("-") row.STEPS = stepsValueIndex[0] skimmerValue = row.SKIMMER skimmerValueIndex = skimmerValue.split("-") row.SKIMMER = skimmerValueIndex[0] lcyclestatValue = row.LCYCLESTAT lcyclestatValueIndex = lcyclestatValue.split("-") row.LCYCLESTAT = lcyclestatValueIndex[0] collectbyValue = row.COLLECTBY collectbyValueIndex = collectbyValue.split("-") row.COLLECTBY = collectbyValueIndex[0] datasourceValue = row.DATASOURCE datasourceValueIndex = datasourceValue.split("-") row.DATASOURCE = datasourceValueIndex[0] erosionValue = row.EROSION erosionValueIndex = erosionValue.split("-") row.EROSION = erosionValueIndex[0] cur.updateRow(row) del row, rows
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.