<?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: Need to rename multiple shapefiles with attribute values in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/need-to-rename-multiple-shapefiles-with-attribute/m-p/479805#M37541</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would also like to know how to do this. I have a list of shapefiles, all with one row in and I want to rename the shapefile using one of the fields. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The explanation above is very vague... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Holly&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Oct 2013 16:12:27 GMT</pubDate>
    <dc:creator>HollySmith</dc:creator>
    <dc:date>2013-10-28T16:12:27Z</dc:date>
    <item>
      <title>Need to rename multiple shapefiles with attribute values</title>
      <link>https://community.esri.com/t5/python-questions/need-to-rename-multiple-shapefiles-with-attribute/m-p/479803#M37539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm at a bit of a loss and need some help please.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm creating a simple model to create masks from features in a shapefile.&amp;nbsp; I select by attribute, then do a buffer so that each buffered feature becomes its own shapefile.&amp;nbsp; Now my problem is that I need to rename those individual buffered shapefiles a value from the its attribute table.&amp;nbsp; All this is being done in model builder as I'm looking at around 500 new shapefiles to be created, for this iteration of the model.&amp;nbsp; The value is a short string, nothing fancy, just a simple code.&amp;nbsp; I would prefer to the following sequence: Iterate --&amp;gt;Buffer --&amp;gt;Rename --&amp;gt;More stuff ---&amp;gt; rince repeat.&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been racking my brain and searching online but can't find anything that really works for what I need.&amp;nbsp; If anyone can help me out it'd be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2012 01:58:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-to-rename-multiple-shapefiles-with-attribute/m-p/479803#M37539</guid>
      <dc:creator>chrisfernandez</dc:creator>
      <dc:date>2012-05-23T01:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need to rename multiple shapefiles with attribute values</title>
      <link>https://community.esri.com/t5/python-questions/need-to-rename-multiple-shapefiles-with-attribute/m-p/479804#M37540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can pass the attribute of your where clause as a variable and inject that into the filename.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Something along these lines.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;attributeList = [1,2,3,4]
queryField = "FIELD_NAME"
for attribute in attributeList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; where = "{0} = {1}".format(queryField,attribute)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Buffer_analysis(input,output+attribute,buffer_dist)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:11:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-to-rename-multiple-shapefiles-with-attribute/m-p/479804#M37540</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-11T21:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need to rename multiple shapefiles with attribute values</title>
      <link>https://community.esri.com/t5/python-questions/need-to-rename-multiple-shapefiles-with-attribute/m-p/479805#M37541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would also like to know how to do this. I have a list of shapefiles, all with one row in and I want to rename the shapefile using one of the fields. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The explanation above is very vague... &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Holly&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 16:12:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-to-rename-multiple-shapefiles-with-attribute/m-p/479805#M37541</guid>
      <dc:creator>HollySmith</dc:creator>
      <dc:date>2013-10-28T16:12:27Z</dc:date>
    </item>
  </channel>
</rss>

