<?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 Using custom Python to identify &amp;amp; pull data from one Attribute Field to populate another in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/using-custom-python-to-identify-amp-pull-data-from/m-p/1346887#M74949</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am looking to use geoprocessing tools or python script in ArcPro to identify numeric data (year) within cells of one attribute table column, pull the year and then populate a corresponding attribute table cell with that data.&amp;nbsp; I've attached a screenshot example of the data for water pipe that I would look to use as a test.&lt;/P&gt;&lt;P&gt;I want to run the tool on a large number of records (over 12,000) have them identify and copy the four digit year from a project (district) description, then populate the 'year_inst' field with said number.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this feasible? Or at least a version of it that I could then QC?&amp;nbsp; I would appreciate any and all feedback as I'm not looking forward to attempting to clean thousands upon thousands of attribute records.&lt;/P&gt;&lt;P&gt;Appreciate this community and any help offered.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;-Matt&lt;/P&gt;</description>
    <pubDate>Tue, 07 Nov 2023 20:20:22 GMT</pubDate>
    <dc:creator>MatthewElbert1</dc:creator>
    <dc:date>2023-11-07T20:20:22Z</dc:date>
    <item>
      <title>Using custom Python to identify &amp; pull data from one Attribute Field to populate another</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/using-custom-python-to-identify-amp-pull-data-from/m-p/1346887#M74949</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am looking to use geoprocessing tools or python script in ArcPro to identify numeric data (year) within cells of one attribute table column, pull the year and then populate a corresponding attribute table cell with that data.&amp;nbsp; I've attached a screenshot example of the data for water pipe that I would look to use as a test.&lt;/P&gt;&lt;P&gt;I want to run the tool on a large number of records (over 12,000) have them identify and copy the four digit year from a project (district) description, then populate the 'year_inst' field with said number.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this feasible? Or at least a version of it that I could then QC?&amp;nbsp; I would appreciate any and all feedback as I'm not looking forward to attempting to clean thousands upon thousands of attribute records.&lt;/P&gt;&lt;P&gt;Appreciate this community and any help offered.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;-Matt&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 20:20:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/using-custom-python-to-identify-amp-pull-data-from/m-p/1346887#M74949</guid>
      <dc:creator>MatthewElbert1</dc:creator>
      <dc:date>2023-11-07T20:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using custom Python to identify &amp; pull data from one Attribute Field to populate another</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/using-custom-python-to-identify-amp-pull-data-from/m-p/1346903#M74950</link>
      <description>&lt;P&gt;Matthew,&lt;/P&gt;&lt;P&gt;This is definitely feasible.&lt;/P&gt;&lt;P&gt;As you iterate over each record, you are extracting the last 4 characters from the 'DISTRICT' field and then updating the 'YR_INST' field with that data. You may need to typecast the year value to a number if the datatype of the 'YR_INST' field isn't a string.&lt;/P&gt;&lt;P&gt;Good luck&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 20:57:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/using-custom-python-to-identify-amp-pull-data-from/m-p/1346903#M74950</guid>
      <dc:creator>AnthonyRyanEQL</dc:creator>
      <dc:date>2023-11-07T20:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using custom Python to identify &amp; pull data from one Attribute Field to populate another</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/using-custom-python-to-identify-amp-pull-data-from/m-p/1346914#M74951</link>
      <description>&lt;P&gt;You could do a Python expression in the Calculate Field tool.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field-examples.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field-examples.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get the last 4 digits (the year) from the string, use string slicing.&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/7983820/get-the-last-4-characters-of-a-string" target="_blank"&gt;https://stackoverflow.com/questions/7983820/get-the-last-4-characters-of-a-string&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Set that equal to a variable, such as my_year, and then calculate the new field value as int(my_year) if the year field is int. If it's a date/time field you'll have to do a little more work, see the date time examples here.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field-examples.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field-examples.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 21:25:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/using-custom-python-to-identify-amp-pull-data-from/m-p/1346914#M74951</guid>
      <dc:creator>BobBooth1</dc:creator>
      <dc:date>2023-11-07T21:25:06Z</dc:date>
    </item>
  </channel>
</rss>

