Skip to main content
deleted 210 characters in body
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

I'm hoping someone knows the answer to this as I am pretty new to Python. What I'm attempting to do is create a list of .dbf tables using a wildcard which I've managed to do. From there my goal is to search the list and extract the value of a specific field. This field only contains 1 row, the value will then be used to populate a field contained in another table which, I haven't begun to attempt yet.Below is a code snippet:

tableList05 = arcpy.ListTables("*_2005.dbf")
#for table05 in tableList05:
with arcpy.SearchCursor(tableList05, ['SUM'])as cursorFive:
    for row in cursorFive:
       print row

For now I'm simply trying to get those values to print before trying to manage how to copy them and update the records in an existing table. The error message I receive when I run this section of code tells me the .dbf tables don't exist. Sorry if this is an easy one, this is my first post also,so there is the possibility that my code is not formatted properly. Thank you.

I'm hoping someone knows the answer to this as I am pretty new to Python. What I'm attempting to do is create a list of .dbf tables using a wildcard which I've managed to do. From there my goal is to search the list and extract the value of a specific field. This field only contains 1 row, the value will then be used to populate a field contained in another table which, I haven't begun to attempt yet.Below is a code snippet:

tableList05 = arcpy.ListTables("*_2005.dbf")
#for table05 in tableList05:
with arcpy.SearchCursor(tableList05, ['SUM'])as cursorFive:
    for row in cursorFive:
       print row

For now I'm simply trying to get those values to print before trying to manage how to copy them and update the records in an existing table. The error message I receive when I run this section of code tells me the .dbf tables don't exist. Sorry if this is an easy one, this is my first post also,so there is the possibility that my code is not formatted properly. Thank you.

What I'm attempting to do is create a list of .dbf tables using a wildcard which I've managed to do. From there my goal is to search the list and extract the value of a specific field. This field only contains 1 row, the value will then be used to populate a field contained in another table which, I haven't begun to attempt yet.Below is a code snippet:

tableList05 = arcpy.ListTables("*_2005.dbf")
#for table05 in tableList05:
with arcpy.SearchCursor(tableList05, ['SUM'])as cursorFive:
    for row in cursorFive:
       print row

For now I'm simply trying to get those values to print before trying to manage how to copy them and update the records in an existing table. The error message I receive when I run this section of code tells me the .dbf tables don't exist.

edited tags
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345
Source Link
standard
  • 622
  • 1
  • 5
  • 14

Using a Search Cursor with a list

I'm hoping someone knows the answer to this as I am pretty new to Python. What I'm attempting to do is create a list of .dbf tables using a wildcard which I've managed to do. From there my goal is to search the list and extract the value of a specific field. This field only contains 1 row, the value will then be used to populate a field contained in another table which, I haven't begun to attempt yet.Below is a code snippet:

tableList05 = arcpy.ListTables("*_2005.dbf")
#for table05 in tableList05:
with arcpy.SearchCursor(tableList05, ['SUM'])as cursorFive:
    for row in cursorFive:
       print row

For now I'm simply trying to get those values to print before trying to manage how to copy them and update the records in an existing table. The error message I receive when I run this section of code tells me the .dbf tables don't exist. Sorry if this is an easy one, this is my first post also,so there is the possibility that my code is not formatted properly. Thank you.