bigDict = { "02-0002-901":{1:"NW1/4SE1/4 LESS W 500 FT, SW1/4NE1/4 LESS W 5", 2:"00 FT OF S 753 FT & N1/2NE1/4 LESS L.P. BIG S", 3:"TONE LAKE-WHETSTONE RIVER PROJECT"}, "02-0002-902":{1:"NW2/4SE2/4 LESS W 501 FT, SW1/4NE1/4 LESS W 5", 2:"00 FT OF S 754 FT & N1/2NE1/4 LESS L.P. BIG S", 3:"TICK LAKE-BLUESTONE RIVER PROJECT"} }
bigDict = {} cur = arcpy.SearchCursor(theTable) for row in cur: par = row.Parcel rec = row.Record leg = row.Legal if bigDict.has_key(par): if not bigDict[par].has_key(rec): bigDict[par][rec] = leg else: pass else: bigDict[par]= {rec:leg}
iCur = InsertCursor(newTable) # for each parcel ID for pKey in bigDict: # make a blank legal description outString = "" # sort the Record keys for this parcel, so they will be in order keyList = bigDict[pKey].keys().sort # loop through them in order: 1, 2, 3 etc for aKey in keyList: # build the concatenated string outString = "%s%s" % (outString, bigDict[pKey][aKey]) # make a new row in the table aNewRow = iCur.newRow() # set the Parcel item to the parcel ID aNewRow.Parcel = pKey # set the legal description to the contactenated string aNewRow.Legal = outString # commit the new row iCur.insertRow(aNewRow)
Hello,I have a table that has one or more lines in for each parcel depending on how long the legal description is. I would like to change it so that there is only one line for each parcel, and several lines for the legal description.Currently the table looks like thisParcel Record Legal02-0002-901 1 NW1/4SE1/4 LESS W 500 FT, SW1/4NE1/4 LESS W 502-0002-901 2 00 FT OF S 753 FT & N1/2NE1/4 LESS L.P. BIG S02-0002-901 3 TONE LAKE-WHETSTONE RIVER PROJECTI would like to change it so that it looks like thisParcel Record Legal Line 1 Legal Line 2 Legal Line 302-0002-901 1 NW1/4SE1/4 LESS W 500 FT, SW1/4NE1/4 LESS W 5 00 FT OF S 753 FT & N1/2NE1/4 LESS L.P. BIG S TONE LAKE-WHETSTONE RIVER PROJECTAny ideas on how to do this via model builder?>
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.