<?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: Populating Attributes via python - All values after a key word in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/populating-attributes-via-python-all-values-after/m-p/1243928#M8221</link>
    <description>&lt;P&gt;many ways, this is but one&lt;/P&gt;&lt;LI-CODE lang="python"&gt;fld ="I am UNIT 99A b c"  # -- a sample field entry
(fld.rpartition("UNIT")[-1]).strip()  # -- python parser of course
'99A b c'  # -- result&lt;/LI-CODE&gt;&lt;P&gt;This partitions a text string based on a separator.&amp;nbsp; [-1] takes the last bit of the partition.&amp;nbsp; strip() just removes any leading or trailing spaces.&lt;/P&gt;&lt;P&gt;replace &lt;STRONG&gt;fld&lt;/STRONG&gt; in the above with your fieldname enclosed in exclamation marks&lt;/P&gt;&lt;P&gt;eg &lt;STRONG&gt;!UnitDescription!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Dec 2022 03:10:30 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2022-12-28T03:10:30Z</dc:date>
    <item>
      <title>Populating Attributes via python - All values after a key word</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/populating-attributes-via-python-all-values-after/m-p/1243826#M8218</link>
      <description>&lt;P&gt;Good Morning All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been tasked with populating a unit (Text Field) attribute in a specific data set. All units in this data are currently blank, BUT inside of the Unit Description field, there is a unit number, that in 99 % of the cases, follows the word "UNIT". So my question is this. Is it possible to create a python script to find the word "UNIT" in the Unit description field, Then populate the Unit field with all characters that follow that word? Thank you in advance for your responses and help&lt;BR /&gt;&lt;BR /&gt;-MD-&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2022 17:09:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/populating-attributes-via-python-all-values-after/m-p/1243826#M8218</guid>
      <dc:creator>MichaelDeliberato</dc:creator>
      <dc:date>2022-12-27T17:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Populating Attributes via python - All values after a key word</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/populating-attributes-via-python-all-values-after/m-p/1243928#M8221</link>
      <description>&lt;P&gt;many ways, this is but one&lt;/P&gt;&lt;LI-CODE lang="python"&gt;fld ="I am UNIT 99A b c"  # -- a sample field entry
(fld.rpartition("UNIT")[-1]).strip()  # -- python parser of course
'99A b c'  # -- result&lt;/LI-CODE&gt;&lt;P&gt;This partitions a text string based on a separator.&amp;nbsp; [-1] takes the last bit of the partition.&amp;nbsp; strip() just removes any leading or trailing spaces.&lt;/P&gt;&lt;P&gt;replace &lt;STRONG&gt;fld&lt;/STRONG&gt; in the above with your fieldname enclosed in exclamation marks&lt;/P&gt;&lt;P&gt;eg &lt;STRONG&gt;!UnitDescription!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 03:10:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/populating-attributes-via-python-all-values-after/m-p/1243928#M8221</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-12-28T03:10:30Z</dc:date>
    </item>
  </channel>
</rss>

