<?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 help with field calculator. in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/need-help-with-field-calculator/m-p/1394188#M80174</link>
    <description>&lt;P&gt;indentation perhaps&lt;/P&gt;&lt;LI-CODE lang="python"&gt;a = "Apple Dr. 245"

def move_numbers_to_front(value):
    words = value.split()
    if len(words) &amp;gt; 1 and words[-1].isnumeric():
        return f"{words[-1]} {' '.join(words[:-1])}"
    return value
    

move_numbers_to_front(a)
'245 Apple Dr.'&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 11 Mar 2024 16:27:37 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2024-03-11T16:27:37Z</dc:date>
    <item>
      <title>Need help with field calculator.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/need-help-with-field-calculator/m-p/1394176#M80173</link>
      <description>&lt;P&gt;I am trying to use field calculator to move numbers to the front of a value. For example, Apple Dr. 245 to 245 Apple Dr. I have tried a bunch of different python scripts that are AI generated but I can't get it to work. Does anyone know why I could be having issues with this? Here is one script I tried for example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;def move_numbers_to_front(value):&lt;BR /&gt;words = value.split()&lt;BR /&gt;if len(words) &amp;gt; 1 and words[-1].isnumeric():&lt;BR /&gt;return f"{words[-1]} {' '.join(words[:-1])}"&lt;BR /&gt;return value&lt;/P&gt;&lt;P&gt;# Usage: move_numbers_to_front(!CableName!)&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 16:10:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/need-help-with-field-calculator/m-p/1394176#M80173</guid>
      <dc:creator>EGardner7</dc:creator>
      <dc:date>2024-03-11T16:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with field calculator.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/need-help-with-field-calculator/m-p/1394188#M80174</link>
      <description>&lt;P&gt;indentation perhaps&lt;/P&gt;&lt;LI-CODE lang="python"&gt;a = "Apple Dr. 245"

def move_numbers_to_front(value):
    words = value.split()
    if len(words) &amp;gt; 1 and words[-1].isnumeric():
        return f"{words[-1]} {' '.join(words[:-1])}"
    return value
    

move_numbers_to_front(a)
'245 Apple Dr.'&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 11 Mar 2024 16:27:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/need-help-with-field-calculator/m-p/1394188#M80174</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2024-03-11T16:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with field calculator.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/need-help-with-field-calculator/m-p/1394267#M80185</link>
      <description>&lt;P&gt;Unfortunately that didn't work. Thank you though!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 18:14:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/need-help-with-field-calculator/m-p/1394267#M80185</guid>
      <dc:creator>EGardner7</dc:creator>
      <dc:date>2024-03-11T18:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with field calculator.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/need-help-with-field-calculator/m-p/1394281#M80188</link>
      <description>&lt;P&gt;Then you might want to provide the error message.&amp;nbsp; Perhaps, you have some null values in the field or other issues with the contents of the field&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 18:32:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/need-help-with-field-calculator/m-p/1394281#M80188</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2024-03-11T18:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with field calculator.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/need-help-with-field-calculator/m-p/1394287#M80190</link>
      <description>&lt;P&gt;Yes there are null values in the field. How do I get it to ignore those? The error message is: There was a failure during processing, check the Geoprocessing Results window for details.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 18:38:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/need-help-with-field-calculator/m-p/1394287#M80190</guid>
      <dc:creator>EGardner7</dc:creator>
      <dc:date>2024-03-11T18:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with field calculator.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/need-help-with-field-calculator/m-p/1394344#M80199</link>
      <description>&lt;P&gt;perhaps&lt;/P&gt;&lt;LI-CODE lang="python"&gt;a = None
def move_numbers_to_front(value):
    if value is None:
        return
    words = value.split()
    if len(words) &amp;gt; 1 and words[-1].isnumeric():
        return f"{words[-1]} {' '.join(words[:-1])}"
    return value
    

print(move_numbers_to_front(a))
None&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 11 Mar 2024 19:51:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/need-help-with-field-calculator/m-p/1394344#M80199</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2024-03-11T19:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with field calculator.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/need-help-with-field-calculator/m-p/1394841#M80247</link>
      <description>&lt;P&gt;did it work? or were there other issues?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 18:49:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/need-help-with-field-calculator/m-p/1394841#M80247</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2024-03-12T18:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with field calculator.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/need-help-with-field-calculator/m-p/1394946#M80258</link>
      <description>&lt;P&gt;Comments like "that didn't work" aren't helpful.&amp;nbsp; If there was an error, what exactly was the error, and provide a traceback if one exists.&amp;nbsp; If there was no error but the results are unexpected, state what you expected and what you got.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 22:01:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/need-help-with-field-calculator/m-p/1394946#M80258</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2024-03-12T22:01:01Z</dc:date>
    </item>
  </channel>
</rss>

