|
POST
|
Try something like this in the field calculator. Expression: ReplaceLastNumber(!textfield!, !numberfield!)
Code block: import re
def ReplaceLastNumber(text_value, number_value):
numbers = re.findall("\d+", text_value)
if numbers:
last_number = numbers[-1]
last_number_index = text_value.rfind(last_number)
return text_value[:last_number_index] + str(number_value) + text_value[last_number_index + len(last_number):]
else:
return text_value
... View more
01-10-2012
09:47 PM
|
0
|
0
|
2354
|
|
POST
|
Try quoting each string in your expression, so instead of exp4 = "!A_PHASE! + !B_PHASE! + !C_PHASE!"
exp5 = "!AB_PHASE! + !AC_PHASE! + !BC_PHASE!" You use exp4 = "'!A_PHASE!' + '!B_PHASE!' + '!C_PHASE!'"
exp5 = "'!AB_PHASE!' + '!AC_PHASE!' + '!BC_PHASE!'"
... View more
01-10-2012
08:08 AM
|
0
|
0
|
1061
|
|
POST
|
Replace ALL \ns with \r\n and you'll need to use </BOL>, not <\BOL>. \r\n is the convention for Windows line breaks, \n is for Unix-like systems. In some places in Windows it's forgiving and lets you use \n, but not in text elements.
... View more
01-03-2012
11:58 AM
|
0
|
0
|
1437
|
|
POST
|
Yes, see the zoomToSelectedFeatures method. There are samples there to get you started.
... View more
12-10-2011
12:20 PM
|
0
|
0
|
1759
|