Guys and gals could you please provide me with a sample code as to how to rename a field name in a Feature Layer or Table. I've been trying to use the FieldInfo object to do so over the last couple of days but it's not happening for me.
Tell me more
×
Geographic Information Systems Stack Exchange is a question and answer site for
cartographers, geographers and GIS professionals. It's 100% free, no registration required.
|
|
What this example code does is to add two NEW fields ("NAME_CITY"; "NAME_REGION") into your fieldinfo with desired new field names instead of just renaming the ORIGINAL field ("NAME_1"; "RegionNames"). After you renamed your fields you need to copy your table view/feature layer into a new table/feature class and that will be your output with renamed fields in it.
Hope this is helpful for you. Thanks, Jinnan |
|||||||||
|
|
Sorry for the delay. I just modified the python script and it is now using the "setNewName" method to rename a existing field instead of adding a new field.
I think this is what you are looking for. Please let me know if you have any questions regarding the code above. Thanks, Jinnan |
|||
|