POST
|
Thank you, Jake! Now it works perfectly. Much appreciated 😄
... View more
07-03-2012
11:51 AM
|
0
|
0
|
598
|
POST
|
Hi Jake, I could not figure out how to add an attachment to a private message. So here is some sample data. Thank you 🙂
... View more
07-03-2012
10:48 AM
|
0
|
0
|
598
|
POST
|
Hi Jake, unfortunately I receive the same error. I replaced the x in the following line with the index of the actual length of my list, like this: if row.ID == fcDict.keys()[10]: That updated my 11 rows just fine. The problem is though that the length of that list varies. Do you know how to fix that. Thank you,
... View more
07-03-2012
09:58 AM
|
0
|
0
|
598
|
POST
|
Hi Jake, thank you! That is exactly, what I am trying to do. I adjusted the code to fit your example and I get an error on line 11: IndexError: list index out of range. Here is my code:
fcDict = {}
rows = arcpy.SearchCursor(infc,"","","","ID")
for row in rows:
fcDict[row.ID] = row.Value
del rows, row
x = 0
rows = arcpy.UpdateCursor(tbl,"","","","ID")
for row in rows:
if row.ID == fcDict.keys() :
row.Value = fcDict[row.ID]
rows.updateRow(row)
x += 1
del rows, row
... View more
06-29-2012
12:27 PM
|
0
|
0
|
598
|
POST
|
Hello everyone, I am a python newbie and trying to update a field in a table based on a field in a feature class. The table already contains unique id's that have to match the id's in the feature class. What happens with the code below is that it goes in an infinite loop where it writes just the first value from the feature class in all the table rows. Any help would be greatly appreciated. # write Value to Table # search cursor scurs = arcpy.SearchCursor(infc) # update cursor ucurs = arcpy.UpdateCursor(tbl) for scur in scurs: newRow = scur.getValue("ID") while newRow <> 0: for ucur in ucurs: ucur.Value = scur.getValue("Value") # update row ucurs.updateRow(ucur)
... View more
06-29-2012
10:09 AM
|
0
|
10
|
1363
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|