Holly, this should get you started... The #'s are Python comments...What you do at the end (writing to new table) really depends on what you calculate and where it ends up. In this little example I created a table, but you could also copy rows or something like that.Also, I haven't tested it out (there could be typo's, etc.).in_tablePath = arcpy.GetParameterAsText(0) # full path to input table (includes name)
out_tablePath = arcpy.GetParameterAsText(1) # path to output table
out_tableName = arcpy.GetParameterAsText(2) # name of output table
featureClass_dataset = arcpy.GetParameterAsText(3) # path to the .gdb (or Folder if .shp) of the feature classes
if not arcpy.Exists(in_tablePath): # check in case table doesn't exist...
arcpy.AddError('Table, ' + in_tablePath + ', does not exist...')
else: # table does exist, continue
arcpy.AddMessage('Using table: ' + in_tablePath) # let the user know the table path
arcpy.CreateTable_management(out_tablePath, out_tableName) # create the output table...
arcpy.AddField_management(out_tablePath+'\\'+out_tableName, "outputData", "DOUBLE") # add a field to the new table
arcpy.CalculateField_management(out_tablePath+'\\'+out_tableName, "outputData", 0, "PYTHON") # calculate its value as 0 for now... (optional)
rowList = arcpy.SearchCursor(in_tablePath)
for row in rowList: # for every row
parcelID = row.getValue("parcelid")
# i.e. if the feature classes are in C:\GIS\Data\parcels.gdb, and parcelID = 7
# will return the feature class C:\GIS\Data\parcels.gdb\7
featureClass = featureClass_dataset + '\\' + str(parcelID) # make sure parcelID is changed to a string as well
if not arcpy.Exists(featureClass): # check in case feature class doesn't exist...
arcpy.AddError('Feature Class, ' + featureClass + ', does not exist...')
else: # feature class exists, continue...
## Do calculations here...
# don't know how you want to write the results, you could use an insert cursor
# or copy selected rows to a new table (or the new table...)
Good luck!Stacy