<?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: Renaming multiple Featureclasses in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7439#M619</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jake,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this worked great, thanks! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also wanted to see if the just "ns" portion could also search featureclasses that are written in capital letters such as "NS"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to make this case- insensitive?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks again!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Apr 2013 12:42:51 GMT</pubDate>
    <dc:creator>RodC</dc:creator>
    <dc:date>2013-04-01T12:42:51Z</dc:date>
    <item>
      <title>Renaming multiple Featureclasses</title>
      <link>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7437#M617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to create a python script that would rename all the feature classes within multiple featuredatasets in a gdb (the gdb is in ArcSDE if that makes any difference). The feature classes are in a set format and I need to change the prefix and part of the suffix.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example:&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;from "road_1234567ns" to "RD_1234567_NS12_13" &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;where 1234567 is the string that I need to keep (and is unique to each feature class) and prefix of "Road" is a constant that I need to replace with "RD_". Suffix is constant as well, "ns" replaced with "_NS12_13" &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The renamed classes will be separated by an underscore&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am just starting out with python and eager to learn more, if anyone has any helpful insights, that would be greatly appreciated. I am using ArcGIS 10.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Mar 2013 17:42:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7437#M617</guid>
      <dc:creator>RodC</dc:creator>
      <dc:date>2013-03-29T17:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming multiple Featureclasses</title>
      <link>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7438#M618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Rodrigo,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is an example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy import env
env.workspace = r"C:\temp\python\test.gdb"

lstDatasets = arcpy.ListDatasets("*")
for dataset in lstDatasets:
&amp;nbsp;&amp;nbsp;&amp;nbsp; lstFCs = arcpy.ListFeatureClasses("road_*", "", dataset)
&amp;nbsp;&amp;nbsp;&amp;nbsp; for fc in lstFCs:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oldName = str(fc)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newName = oldName.replace("road", "RD")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newName = newName.replace("ns", "_NS12_13")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Rename_management(fc, newName)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:18:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7438#M618</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-10T20:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming multiple Featureclasses</title>
      <link>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7439#M619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jake,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this worked great, thanks! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also wanted to see if the just "ns" portion could also search featureclasses that are written in capital letters such as "NS"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to make this case- insensitive?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks again!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 12:42:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7439#M619</guid>
      <dc:creator>RodC</dc:creator>
      <dc:date>2013-04-01T12:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming multiple Featureclasses</title>
      <link>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7440#M620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could do something like below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;lstDatasets = arcpy.ListDatasets("*") for dataset in lstDatasets: &amp;nbsp;&amp;nbsp;&amp;nbsp; lstFCs = arcpy.ListFeatureClasses("road_*", "", dataset) &amp;nbsp;&amp;nbsp;&amp;nbsp; for fc in lstFCs: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if "NS" in fc: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oldName = str(fc) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newName = oldName.replace("road", "RD") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newName = newName.replace("NS", "_NS12_13") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Rename_management(fc, newName)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 13:01:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7440#M620</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2013-04-01T13:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming multiple Featureclasses</title>
      <link>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7441#M621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Jake,&lt;BR /&gt;&lt;BR /&gt;this worked great, thanks! &lt;BR /&gt;&lt;BR /&gt;I also wanted to see if the just "ns" portion could also search featureclasses that are written in capital letters such as "NS"?&lt;BR /&gt;Is there a way to make this case- insensitive?&lt;BR /&gt;&lt;BR /&gt;thanks again!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Disregard this question.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I got it to work! just added another newName line&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 13:02:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7441#M621</guid>
      <dc:creator>RodC</dc:creator>
      <dc:date>2013-04-01T13:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming multiple Featureclasses</title>
      <link>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7442#M622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the information. I'm looking to do the opposite where I would like to create a suffix on many different feature class names like '_1405' for example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2014 03:29:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7442#M622</guid>
      <dc:creator>ChrisGraves1</dc:creator>
      <dc:date>2014-08-14T03:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming multiple Featureclasses</title>
      <link>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7443#M623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I run this it only replaces the text for the last "newName" line, so in your example it would only replace the "ns" with "_NS12_13" and ignore the line that replaces "road". Any idea why that might be?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 20:02:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7443#M623</guid>
      <dc:creator>danashney</dc:creator>
      <dc:date>2014-09-10T20:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming multiple Featureclasses</title>
      <link>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7444#M624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris, you would concatenate the original featureclass name with the new suffix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14103797140609367" jivemacro_uid="_14103797140609367"&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f6f6f6;"&gt;newName = str(fc) + '_1045'&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 20:08:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7444#M624</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2014-09-10T20:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming multiple Featureclasses</title>
      <link>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7445#M625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know this is many years after the initial post, but holy cow, thank you so much for this. Using this, I was able to automate renaming 500+ feature classes.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2020 14:50:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/7445#M625</guid>
      <dc:creator>MDB_GIS</dc:creator>
      <dc:date>2020-08-04T14:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming multiple Featureclasses</title>
      <link>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/1308215#M68168</link>
      <description>&lt;P&gt;Any help on how to replace the last 3 characters across multiple feature class names?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 14:14:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/renaming-multiple-featureclasses/m-p/1308215#M68168</guid>
      <dc:creator>AREGIS</dc:creator>
      <dc:date>2023-07-14T14:14:23Z</dc:date>
    </item>
  </channel>
</rss>

