Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Calculate field iteration through several GDB in one Folder

$
0
0
Not sure why I cannot get this simple script to work. I feel like I have been using python regularly but do not understand why this script will not work. I get a Syntax error on line 14. I have tried several variations of the script, trying quotations brackets etc.. for the CalculateField argument. I am trying to take the values found in DIST_TYPE and use them in the field ODISTTYPE.

Thanks

Code:

# Import arcpy module
import arcpy, sys, traceback
arcpy.env.overwriteOutput = True
from os import path as p
 
arcpy.env.workspace = r"G:\ChrisGIS\COMBO_fishdist_events"
 
try:
        for ws in arcpy.ListWorkspaces("*", "FileGDB"):
                arcpy.env.workspace = ws
                listFCS = arcpy.ListTables("WDFW_*_ONLY")
                for inputFC in listFCS:
                        arcpy.CalculateField_management(inputFC, "WDFW_ODISTTYPE", "DIST_TYPE", "VB")


Viewing all articles
Browse latest Browse all 2485

Trending Articles