Solved! Go to Solution.
I have a large dataset in ArcGIS10 with numeric characters followed by an asterisk and then a series of either numbers or letters. I would like to be able to create a new field with only the characters to the right of the asterisk. The left() and right() functions by themselves don't work for me, because there is no standard number of characters before or after the asterisk.
Example of data...
201*H
1296*CH
37901*001
Would like to create a new field with...
H
CH
001
Thanks for your help,
Joe
!field_name!.split("*")[-1]
I have a large dataset in ArcGIS10 with numeric characters followed by an asterisk and then a series of either numbers or letters. I would like to be able to create a new field with only the characters to the right of the asterisk. The left() and right() functions by themselves don't work for me, because there is no standard number of characters before or after the asterisk.
Example of data...
201*H
1296*CH
37901*001
Would like to create a new field with...
H
CH
001
Thanks for your help,
Joe
!field_name!.split("*")[-1]
Example: Some Subdivision Sec 3; I want Sec 3 in a new field.
>>> value = 'Lakeview Sec 2' >>> section = ' '.join(value.split()[-2:]) >>> print section Sec 2 >>>
" ".join(!Subdivision!.split()[-2:])