I need help! I am writing a program that will look through the table of a station layer and then go to the annotation layer and list all the missing values. For Example: The station layer has a field called TFLAG which has the station id in it. The annotation layer has a field called TFLAG with the same station id in it. I want to look through the annotation layer and find all the missing values that the station layer has that the annotation layer is missing. I have written some code. I need to know if I am headed in the right direction!!
import arcpy, os, sys, string
arcpy.env.overwriteOutput = True
fc = "K:\TASS\4_MAPPING_DATA_SUPPORT\Traffic_Mapping\Traffic_Count_Data\2011_Counts\2011_Annual_Stations\Final_Annual_Stations_2012.shp"
fields = ("TFLAG", "T_FLAG")
Value = "TFLAG" <> "T_FLAG"
where = "%s = '%s'" % (field, vlaue)
dhList = []
for w in ws:
arcpy.env.workspace = w
gdb = arcpy.ListWorkspaces ("*", "TFLAG")
for fc in gdb:
arcpy.env.workspace = fc
.dais important because it's aSearchCursorin a different library. At the top, try addingimport arcpy.daamong the other imports. What version of ArcGIS do you have? – elrobis Apr 19 '13 at 20:52dais short for DataAccess module, and I got thearcpy.da.SearchCursorbit from this answer, but here is the ESRI page documenting that class. I haven't been able to quickly confirm if the wholedamodule is exclusive to Arc 10.1, or if it's in 10. – elrobis Apr 19 '13 at 21:12SearchCursordifferently (without going through thedamodule, and even applying your fieldname parameter in a different part of the constructor). I added two commented-out lines of code that you can swap out for the lines I provided initially. Hopefully that will make the difference. – elrobis Apr 19 '13 at 21:24