<?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: Field Calc help in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/field-calc-help/m-p/568687#M44560</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have the luxury of being sure the values are comma separated...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not you use an AGOL endpoint and build URLs with your data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text=Redlands+CA+92373&amp;amp;outFields=*&amp;amp;f=pjson" title="http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text=Redlands+CA+92373&amp;amp;outFields=*&amp;amp;f=pjson"&gt;http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text=Redlands+CA+92373&amp;amp;outFields=*&amp;amp;f=pjson&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or geocode the data with the USA Postal locator used by AGOL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;\\dharma\Benchmark_Data\Geocoding\LocatorImprovements\Locators_Release_July2014\LocatorData\USA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Aug 2014 20:00:46 GMT</pubDate>
    <dc:creator>BruceHarold</dc:creator>
    <dc:date>2014-08-21T20:00:46Z</dc:date>
    <item>
      <title>Field Calc help</title>
      <link>https://community.esri.com/t5/python-questions/field-calc-help/m-p/568683#M44556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need help with VB Script or Python.&amp;nbsp; I have a "CityStateZip" field and I am trying to break it down into a "City" field, "State" field and a "Zip" field.&amp;nbsp; The value in CityStateZip looks like "San Francisco, CA 94110"&amp;nbsp; What scripts can I use in Field Calculate to separate out these values?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2014 19:26:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calc-help/m-p/568683#M44556</guid>
      <dc:creator>ChuckShaw</dc:creator>
      <dc:date>2014-08-21T19:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calc help</title>
      <link>https://community.esri.com/t5/python-questions/field-calc-help/m-p/568684#M44557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To get city (assuming no city names contain a comma):&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14086501197214883 jive_text_macro" jivemacro_uid="_14086501197214883"&gt;
&lt;P&gt;!address!.split(",")[0]&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get state:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14086502036568347" jivemacro_uid="_14086502036568347"&gt;
&lt;P&gt;!address!.split(",")[1].split(" ")[1]&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get zip:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14086502104611141" jivemacro_uid="_14086502104611141"&gt;
&lt;P&gt;!address!.split(",")[1].split(" ")[2]&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There may be some special cases where this doesn't work, depending on your data. This works for data like: "CityName"[comma][space]"State"[space]"Zip"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2014 19:46:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calc-help/m-p/568684#M44557</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2014-08-21T19:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calc help</title>
      <link>https://community.esri.com/t5/python-questions/field-calc-help/m-p/568685#M44558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Much thanks Darren!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2014 19:56:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calc-help/m-p/568685#M44558</guid>
      <dc:creator>ChuckShaw</dc:creator>
      <dc:date>2014-08-21T19:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calc help</title>
      <link>https://community.esri.com/t5/python-questions/field-calc-help/m-p/568686#M44559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chuck,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How familiar are you with python? There are some fairly easy ways to do this, you will need to make 3 new fields for City, State, and Zip.&amp;nbsp; In the field calculator, select python&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the city field try&lt;/P&gt;&lt;P&gt;!CityStateZip!.split(",")[0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the State field try&lt;/P&gt;&lt;P&gt;!CityStateZip!.split(",")[1][1:3]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for the Zip field try&lt;/P&gt;&lt;P&gt;!CityStateZip!.split(",")[1][4:]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You definitely will need to spot check your results, I'm basing this entirely on your entries all being similar to the one posted, without it getting very fancy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2014 19:56:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calc-help/m-p/568686#M44559</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-08-21T19:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calc help</title>
      <link>https://community.esri.com/t5/python-questions/field-calc-help/m-p/568687#M44560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have the luxury of being sure the values are comma separated...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not you use an AGOL endpoint and build URLs with your data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text=Redlands+CA+92373&amp;amp;outFields=*&amp;amp;f=pjson" title="http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text=Redlands+CA+92373&amp;amp;outFields=*&amp;amp;f=pjson"&gt;http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find?text=Redlands+CA+92373&amp;amp;outFields=*&amp;amp;f=pjson&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or geocode the data with the USA Postal locator used by AGOL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;\\dharma\Benchmark_Data\Geocoding\LocatorImprovements\Locators_Release_July2014\LocatorData\USA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2014 20:00:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-calc-help/m-p/568687#M44560</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2014-08-21T20:00:46Z</dc:date>
    </item>
  </channel>
</rss>

