<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Change field names with Python - new question in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550543#M43036</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So this is how my FC is now as shown below . I want to delete Join_Count, TARGET_FID, JOIN_FID and change the "appellation to Appellation" "affected_surveys to Affected_Surveys" and similar with the other fields&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="49" src="https://community.esri.com/legacyfs/online/183136_pastedImage_1.png" style="width: 707px; height: 48.8991px;" width="707" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Feb 2016 02:19:41 GMT</pubDate>
    <dc:creator>JKBellamkonda</dc:creator>
    <dc:date>2016-02-17T02:19:41Z</dc:date>
    <item>
      <title>Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550534#M43027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Import system modules
print "Importing modules"
import arcpy
import os

# Check out extensions and Overwrite outputs
print "Checking for extensions and Overwrite outputs"
arcpy.CheckOutExtension("Analysis")
arcpy.CheckOutExtension("Data Management")
arcpy.env.overwriteOutput = True

# Input Parameters
print "checking input Parameters"
infeature = arcpy.GetParameterAsText(0)
delete_fields = arcpy.GetParameterAsText(1)

# Delete unwanted fields
print "Deleting unwanted fields"
arcpy.DeleteField_management (infeature, [delete_fields])

# Alter field alias by capitalising the initial letter of the word.
print "Changing the field alias by turning 1st letter of the word to uppercase"
fields = arcpy.ListFields(infeature)
for field in fields:
&amp;nbsp;&amp;nbsp; fname = field.name
&amp;nbsp;&amp;nbsp; alias = fname.title()
&amp;nbsp;&amp;nbsp; arcpy.AlterField_management (infeature, field, alias)

print "done"&lt;/PRE&gt;&lt;P&gt;Hi Sephe Fox,&lt;/P&gt;&lt;P&gt;I have been trying to dig into this code to alter it to my specifications, but seems like I am lost. could you help me out with this please. Trying to create a script tool that allows you to delete fields and alter alias names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Branched to new question by: Xander Bakker From original thread: &lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2145" data-containertype="14" data-objectid="151288" data-objecttype="1" href="https://community.esri.com/thread/151288" target="_blank"&gt;https://community.esri.com/thread/151288&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:49:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550534#M43027</guid>
      <dc:creator>JKBellamkonda</dc:creator>
      <dc:date>2021-12-11T23:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550535#M43028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/50964"&gt;JK Bellamkonda&lt;/A&gt; , I branched you question to a new thread. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed a few things that will generate problems in the script you posted. &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;You check out the "extensions" Analysis and Data Management, on lines 8 and 9, but these are toolboxes and not extensions and can be used without loading or checking out anything.&lt;/LI&gt;&lt;LI&gt;You read on line 15 the list of fields as a string. Normally a list is parsed as a string separated by a semicolon. You should split that string by the semicolon to be able to get a list that can be used on line 19 to delete a list of fields. For instance: &lt;EM&gt;lst_fields = delete_fields.split(';')&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;On line 27 you specify a field object to identify the field to be altered. The documentation of this function has some errors. You should specify the field name (field.name) instead. &lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will add feedback to the Help page to have that fixed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 11:17:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550535#M43028</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2016-02-16T11:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550536#M43029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also,&amp;nbsp; the alias name does not seem to recognize a case change. So if you are attempting to change just the first letter to uppercase and it does not appear to be successful you may want to look at the workaround &lt;A _jive_internal="true" href="https://community.esri.com/thread/169846"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 12:36:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550536#M43029</guid>
      <dc:creator>LukeSturtevant</dc:creator>
      <dc:date>2016-02-16T12:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550537#M43030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migration-blogpost/1163"&gt;Xander Bakker's Blog&lt;/A&gt; thanks for your response. As I mentioned earlier I am trying to convert this in to a tool, regarding line 15 I have set the parameters for the tool to delete only selected fields as shown below. only thing I am struggling with is line 27 to loop over the rest of the fields and change alias. Thanks to &lt;A href="https://community.esri.com/migrated-users/71545"&gt;Luke Sturtevant&lt;/A&gt;​ for mentioning issue with Alias case change. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/182977_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 19:18:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550537#M43030</guid>
      <dc:creator>JKBellamkonda</dc:creator>
      <dc:date>2016-02-16T19:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550538#M43031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm testing out the OTB tool &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/alter-field-properties.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/alter-field-properties.htm"&gt;Alter Field—Help | ArcGIS for Desktop&lt;/A&gt; which in thoey&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Rename fields and field aliases, or alter field properties&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this actually does this by adding a new field, deleting the old.&amp;nbsp; Unfortunately, although it lists being able to change the length, etc., it doesn't seem to be able to do this unless the FC is empty...which is a bummer in my case (need to just append into a new structure I guess).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, is this what you are trying to do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" height="157" src="https://community.esri.com/legacyfs/online/183112_pastedImage_0.png" style="width: 140px; height: 157.131px;" width="140" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 23:38:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550538#M43031</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-02-16T23:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550539#M43032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/2691"&gt;Rebecca Strauch, GISP&lt;/A&gt;​ I am only trying to change the field alias. its such a task to create new fields, copy and delete the old ones. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 23:54:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550539#M43032</guid>
      <dc:creator>JKBellamkonda</dc:creator>
      <dc:date>2016-02-16T23:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550540#M43033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the help says...&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt; "This tool provides the ability to rename fields or rename field aliases for any geodatabase table or feature class."&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;and the renaming the field is optional.&amp;nbsp; I just did it, and although I had to removed the FC from my TOC in ArcMap, when I added it back, the alias was changed.&amp;nbsp; If you also change the fieldname, it is moved to the end of the list.&amp;nbsp; But changing the alias only left it in the same order.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="183132" alt="" class="image-2 jive-image" height="218" src="https://community.esri.com/legacyfs/online/183132_pastedImage_3.png" style="width: 441px; height: 217.655px;" width="441" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After reopening the file (an f5 refresh didn't seem to be enough)&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="183131" alt="" class="image-1 jive-image" height="172" src="https://community.esri.com/legacyfs/online/183131_pastedImage_2.png" style="width: 356px; height: 171.575px;" width="356" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my snippet after running...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Replace a layer/table view name with a path to a dataset (which can be a layer file) or create the layer/table view within the script
# The following inputs are layers or table views: "tmppt1final"
arcpy.AlterField_management(in_table="tmppt1final", field="DDMLat_12", new_field_name="", new_field_alias="blah", field_type="TEXT", field_length="255", field_is_nullable="NULLABLE", clear_field_alias="false")&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should be possible to create a list of the [in_table, field, new_field_alias]&amp;nbsp; and loop thru them to have them updated.&amp;nbsp; I did the above manually, but about to put this to use in my script (but I'm going to rename the duplicate names, in my case).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: btw - took&amp;nbsp; 0.08 seconds to run the command.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:49:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550540#M43033</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2021-12-11T23:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550541#M43034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A href="https://community.esri.com/migrated-users/2691"&gt;Rebecca Strauch, GISP&lt;/A&gt;​ . I dont really want to hard code the field names as I will be using it as a script tool . Can you guide me how to use the existing field names in my code( keeping in mind that my code also deletes few fields prior to Alter field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 01:38:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550541#M43034</guid>
      <dc:creator>JKBellamkonda</dc:creator>
      <dc:date>2016-02-17T01:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550542#M43035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm doing something similar right now in my script.&amp;nbsp; I have (from previous processing) three lists that include coordinates that I am creating three point FC, and getting coordinates in XY-projection, and Geographic coord in DD, DDM and DMS.....(using Project, addxy, and &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/convert-coordinate-notation.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/convert-coordinate-notation.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Convert Coordinate Notation—Help | ArcGIS for Desktop&lt;/A&gt;) then merging the three files with JoinField.&amp;nbsp; really messy if I let ArcGIS autoname the fields, since they are the same in each.&amp;nbsp; So I'm going to alter the field names to include "pt1", "pt2", etc, and change the length of the auto TEXT fields from 255 to 15.&amp;nbsp; As I mentioned, just starting to work on this.&amp;nbsp; But I am also deleting fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some tools that may help you...(Look at the code samples)&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-functions/listfields.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-functions/listfields.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;ListFields—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fyi..my input starts like&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;pt1List =&amp;nbsp; [[104, 259572.28396514762, 1569679.2337295527, u'Contour', 2333, 711, 3338], [102, 307382.1354489387, 1540435.947750746, u'Contour', 5738, 1749, 3338], [103, 318046.4257102255, 1572115.318007391, u'Contour', 5646, 1721, 3338]]
pt2List = [[104, 261920.13532314647, 1571191.8980065093], [102, 310325.1529914262, 1538520.823783757], [103, 318832.6403342534, 1572402.314232631]]
pt3List = [[104, 262729.2297764599, 1574104.0470867334], [102, 311161.3833612903, 1542535.1787147326], [103, 320759.5157311091, 1571095.6504666873]]&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and my current output is....&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; outFCdms = 'tmppt1final'
... aaa = arcpy.ListFields(outFCdms)
... for i in aaa:
...&amp;nbsp;&amp;nbsp; print(i.name, i.type, i.length)
(u'OID', u'OID', 4)
(u'Shape', u'Geometry', 0)
(u'PtID', u'SmallInteger', 2)
(u'TransType', u'String', 25)
(u'elev_ft', u'SmallInteger', 2)
(u'elev_m', u'SmallInteger', 2)
(u'xyProjID', u'SmallInteger', 2)
(u'x', u'Double', 8)
(u'y', u'Double', 8)
(u'ddlat', u'Double', 8)
(u'ddlong', u'Double', 8)
(u'POINT_X', u'Double', 8)
(u'POINT_Y', u'Double', 8)
(u'DDLat_1', u'Double', 8)
(u'DDLon', u'Double', 8)
(u'DDMLat', u'String', 255)
(u'DDMLon', u'String', 255)
(u'DMSLat', u'String', 255)
(u'DMSLon', u'String', 255)
(u'ddlat_12', u'Double', 8)&amp;nbsp;&amp;nbsp; # etc.&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And this is something that will be run numerous times....so I will need to script it too....but for me, I'll do it at the FC before my jooining the 3 tables.&amp;nbsp; This is probably not exactly what you are doing, but probably similar.&amp;nbsp; If you give an example of where you are starting and what you would like in the end, it would be easier for others to help.&amp;nbsp; I can share what I come up with too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:49:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550542#M43035</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2021-12-11T23:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550543#M43036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So this is how my FC is now as shown below . I want to delete Join_Count, TARGET_FID, JOIN_FID and change the "appellation to Appellation" "affected_surveys to Affected_Surveys" and similar with the other fields&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="49" src="https://community.esri.com/legacyfs/online/183136_pastedImage_1.png" style="width: 707px; height: 48.8991px;" width="707" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 02:19:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550543#M43036</guid>
      <dc:creator>JKBellamkonda</dc:creator>
      <dc:date>2016-02-17T02:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550544#M43037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try something like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;fc = 'tmppt1final'
dropFields = "DDlat_1; DDLon"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # removed [ ]&amp;nbsp; one test wanted them...next one didn't
alterFields = [["elev_ft", "Elev_FT"], ["elev_m", "Elev_M"], ["x", "X"], ["y", "Y"]]
arcpy.DeleteField_management(fc, dropFields)
for old, new in alterFields:
&amp;nbsp; tmpName = ("{0}_tmp".format(old))
&amp;nbsp; arcpy.AlterField_management(fc, old, tmpName)
&amp;nbsp; arcpy.AlterField_management(fc, tmpName, new)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;changing you "fc" and the dropFields (a list of fields, separated by a semi-colon) and AlterFields (oldname and new name, for each field)&lt;/P&gt;&lt;P&gt;I changed the field name....but you could adjust it for the alias.&amp;nbsp; As mentioned earlier, if only changing alias, the fields seem to stay in the same order....changing the name puts the field at the end.&amp;nbsp; So, you would need to update each field in order to get them back (I don't think there is a change field order command...but may need to look again for my purposes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are ways you could probably automate the new name with the first letter of a word always in Caps, etc....and skipping some fields you don't want that to happen on.&amp;nbsp; There are other threads that talk about things like that, and &lt;A href="https://community.esri.com/migrated-users/3116" target="_blank"&gt;Dan Patterson&lt;/A&gt;​ might have somethin in his blogs already....and he has magical things happening with lists, etc...but I tend to try to keep things simple for me in the future....I'm a good hack...not hacker.&amp;nbsp; Couple others I can think of to tag here are &lt;A href="https://community.esri.com/migrated-users/3100" target="_blank"&gt;Xander Bakker&lt;/A&gt;​ &lt;A href="https://community.esri.com/migrated-users/17314" target="_blank"&gt;Darren Wiens&lt;/A&gt;​&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&amp;nbsp; updated my code above to remove the&amp;nbsp; [ ] on the dropFields list.&amp;nbsp; For some reason my machine wanted them when testing....but once I had it in my script, it didn't&amp;nbsp; go figure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:49:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550544#M43037</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2021-12-11T23:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550545#M43038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rebecca, try&amp;nbsp; .... title&amp;nbsp; ... others include upper, lower etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; a = "elev_ft"
&amp;gt;&amp;gt;&amp;gt; a.title()
'Elev_Ft'&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:49:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550545#M43038</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T23:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550546#M43039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's not what I need right now, but that would probably work for JK's needs.&amp;nbsp; Testing on a list, and printing...&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;fc = 'tmppt1final'&amp;nbsp; &lt;/P&gt;&lt;P&gt;alterFields = ["elev_ft", "elev_m", "x", "y"]&amp;nbsp; &lt;/P&gt;&lt;P&gt;for old in alterFields:&lt;/P&gt;&lt;P&gt;&amp;nbsp; tmpName = ("{0}_tmp".format(old))&lt;/P&gt;&lt;P&gt;&amp;nbsp; new = old.title()&lt;/P&gt;&lt;P&gt;&amp;nbsp; print("old: {0}, tmp: {1}, new: {2}".format(old,tmpName,new))&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Thanks Dan....that might come in handy for me some day.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 03:22:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550546#M43039</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-02-17T03:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550547#M43040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jk,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a batch rename alias field tool that might be helpful as a template. &lt;BR /&gt;&lt;A href="https://community.esri.com/docs/DOC-7039"&gt;Batch Rename Field Alias&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I use a text string that is split so it can do them in batch. Hope this is helpful.&lt;BR /&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 02:59:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550547#M43040</guid>
      <dc:creator>DavidWasserman</dc:creator>
      <dc:date>2016-02-19T02:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550548#M43041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migration-blogpost/10051"&gt;David Wasserman's Blog&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Thanks for the tool. It was really helpful but I am trying to automate the whole process so that I don't have to spend time typing all the alias names.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2016 20:11:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550548#M43041</guid>
      <dc:creator>JKBellamkonda</dc:creator>
      <dc:date>2016-02-22T20:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550549#M43042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi JK, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand! I specifically designed this one just to deal with data that was processed a lot or data sets whose fields don't change (so the same tool run could be used over and over for templated data). Just thought it might be a useful template for a final tool etc. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the case of making all the aliases title case, you could modify my script to instead take a list of field names, then cast them as a string (str(unicode) just in case), then use the title method mentioned earlier in the thread. It seems like you are on the right track regardless. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2016 20:17:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550549#M43042</guid>
      <dc:creator>DavidWasserman</dc:creator>
      <dc:date>2016-02-22T20:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550550#M43043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Finally managed to create a tool that does what I wanted, thanks to &lt;A href="https://community.esri.com/migrated-users/2691" target="_blank"&gt;Rebecca Strauch, GISP&lt;/A&gt;, &lt;A href="https://community.esri.com/migration-blogpost/10051" target="_blank"&gt;David Wasserman's Blog&lt;/A&gt;&amp;nbsp; and &lt;A href="https://community.esri.com/migrated-users/71545" target="_blank"&gt;Luke Sturtevant&lt;/A&gt; for your guidance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Import system modules
import arcpy
import os

# Check out extensions and Overwrite outputs
arcpy.env.overwriteOutput = True

# Input Parameters
infeature = arcpy.GetParameterAsText(0)

# List all the field names of infeature.
fields = arcpy.ListFields(infeature)

# Change the field alias inital letters of the word to uppercase.
print "Changing the field alias to field name by Capitalising the initial letter"
for field in fields:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not field.required:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # change field alias to a temporary name to recognise change by stripping of last 2 charecters
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AlterField_management (infeature, field.name, field.name, field.name.rstrip(field.name[-2:]))


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Change the field alias back to original field name without underscores and turn the initial letter of the word to uppercase
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AlterField_management (infeature, field.name, field.name, field.name.replace("_"," ").title())

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Script Completed Successfully"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:49:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550550#M43043</guid>
      <dc:creator>JKBellamkonda</dc:creator>
      <dc:date>2021-12-11T23:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Change field names with Python - new question</title>
      <link>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550551#M43044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for sharing this. I might want to modify my tools based on some of the ideas here! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Mar 2016 21:46:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-field-names-with-python-new-question/m-p/550551#M43044</guid>
      <dc:creator>DavidWasserman</dc:creator>
      <dc:date>2016-03-02T21:46:40Z</dc:date>
    </item>
  </channel>
</rss>

