I'm trying to find an example of a python script for ArcGIS 10.1 that will get count of a feature class (FC) in my ArcSDE and get count of a FC in an incoming file geodatabase update and then write the difference to a log file. We get monthly updates from a vendor. For instance, wells FC, and want to be able to compare record counts and log diff (a-b=C). Right now I have a script that will record start time, get count, truncate, append, rebuild index.
Answer
Here's a one-liner for getting the count of records in a specific FC or table:
count = sum(1 for row in arcpy.da.SearchCursor(r'C:\PATH\TO\FC', ['OID@']))
No comments:
Post a Comment