<?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: I need to iterate through field(column) names in a table and change them. in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/i-need-to-iterate-through-field-column-names-in-a/m-p/236448#M13409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry about that, I guess the best way to describe it is to generate the list of field names and then strip them down to dates only, or at least shorter.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Jul 2020 14:37:49 GMT</pubDate>
    <dc:creator>DanielAmrine</dc:creator>
    <dc:date>2020-07-31T14:37:49Z</dc:date>
    <item>
      <title>I need to iterate through field(column) names in a table and change them.</title>
      <link>https://community.esri.com/t5/data-management-questions/i-need-to-iterate-through-field-column-names-in-a/m-p/236445#M13406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used pivot table to place dates as individual fields(columns) but pivot table attaches the name of the original&amp;nbsp;&lt;/P&gt;&lt;P&gt;field to each new pivoted column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/501916_Pivot_example.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are hundreds of these columns and i need can't change the name one by one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2020 04:40:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/i-need-to-iterate-through-field-column-names-in-a/m-p/236445#M13406</guid>
      <dc:creator>DanielAmrine</dc:creator>
      <dc:date>2020-07-31T04:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: I need to iterate through field(column) names in a table and change them.</title>
      <link>https://community.esri.com/t5/data-management-questions/i-need-to-iterate-through-field-column-names-in-a/m-p/236446#M13407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm unsure of what you want to do exactly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2020 10:50:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/i-need-to-iterate-through-field-column-names-in-a/m-p/236446#M13407</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-07-31T10:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: I need to iterate through field(column) names in a table and change them.</title>
      <link>https://community.esri.com/t5/data-management-questions/i-need-to-iterate-through-field-column-names-in-a/m-p/236447#M13408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you want to change them to?&amp;nbsp; Is it a matter of slicing up the existing name and using just part of it for the new name? As &lt;A href="https://community.esri.com/migrated-users/390241"&gt;David Pike&lt;/A&gt;‌ suggests, a little more jnfo to your end game would be helpful.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might consider looping through a &lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/functions/listfields.htm"&gt;list of field names&lt;/A&gt; and then use &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/alter-field-properties.htm"&gt;alter fields&lt;/A&gt; to make the changes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2020 11:45:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/i-need-to-iterate-through-field-column-names-in-a/m-p/236447#M13408</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-07-31T11:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: I need to iterate through field(column) names in a table and change them.</title>
      <link>https://community.esri.com/t5/data-management-questions/i-need-to-iterate-through-field-column-names-in-a/m-p/236448#M13409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry about that, I guess the best way to describe it is to generate the list of field names and then strip them down to dates only, or at least shorter.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2020 14:37:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/i-need-to-iterate-through-field-column-names-in-a/m-p/236448#M13409</guid>
      <dc:creator>DanielAmrine</dc:creator>
      <dc:date>2020-07-31T14:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: I need to iterate through field(column) names in a table and change them.</title>
      <link>https://community.esri.com/t5/data-management-questions/i-need-to-iterate-through-field-column-names-in-a/m-p/236449#M13410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Joe, I will test this today. I couldn't remember how to make the list.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2020 14:38:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/i-need-to-iterate-through-field-column-names-in-a/m-p/236449#M13410</guid>
      <dc:creator>DanielAmrine</dc:creator>
      <dc:date>2020-07-31T14:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: I need to iterate through field(column) names in a table and change them.</title>
      <link>https://community.esri.com/t5/data-management-questions/i-need-to-iterate-through-field-column-names-in-a/m-p/236450#M13411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'll need to be careful with the way you end up with a field name.&amp;nbsp; If all you want is the date, for example '1/1/'000' you can easily split the field name at the word 'date' and get the slice you want:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;fieldName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Monthly_Production_Date1/1/2000'&lt;/SPAN&gt;
justTheDate &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; fieldName&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Date'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="string token"&gt;''' justTheDate = '1/1/2000' '''&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You've got two things working against you though:&lt;/P&gt;&lt;P&gt;1: Field names can't begin with a number&lt;/P&gt;&lt;P&gt;2: I'm not sure that a field name can contain a special character as a fore slash&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:55:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/i-need-to-iterate-through-field-column-names-in-a/m-p/236450#M13411</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T11:55:37Z</dc:date>
    </item>
  </channel>
</rss>

