<?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: Python Script to Automate Zip Codes Help in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-to-automate-zip-codes-help/m-p/457519#M35942</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then there is the blogs on &lt;A _jive_internal="true" href="https://community.esri.com/blogs/dan_patterson/2016/03/01/basic-fancy-formats"&gt;Basic Fancy Formatting&lt;/A&gt;... with references to Fancy Fancy Formatting and a variety of other tips.&amp;nbsp; You can waste a whole day making stuff look nice without getting any meaningful work done... all the tips are there &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Jun 2017 18:34:28 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2017-06-20T18:34:28Z</dc:date>
    <item>
      <title>Python Script to Automate Zip Codes Help</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-automate-zip-codes-help/m-p/457516#M35939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I am dealing with zip codes and when the zip code starts with 0, excel does not keep and when I import into arcmap, I therefore have issues joining to other shapefiles with a zip-code field. I am trying to&amp;nbsp;write a script that will automate this process and calculate a new field to ensure that all zip codes have 5 digits but I cant get it to work. Attached is what I have written in python, essentially to determine the length of the zip code, and if it is complete (5digits) just make I a string and if it is not, to concatenate the necessary number of 0s to make it 5 digits. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2017 17:10:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-automate-zip-codes-help/m-p/457516#M35939</guid>
      <dc:creator>MadeleineHaynes</dc:creator>
      <dc:date>2017-06-20T17:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Automate Zip Codes Help</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-automate-zip-codes-help/m-p/457517#M35940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just looking at your expression, and not addressing the script, what you want can be easily accomplishing using &lt;A href="https://docs.python.org/2/library/string.html#format-string-syntax"&gt;Python string formatting&lt;/A&gt;:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="string token"&gt;"{:0&amp;gt;5}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;!agent_zip!&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, this will get more visibility if posted in &lt;A href="https://community.esri.com/community/developers/gis-developers/python?sr=search&amp;amp;searchId=f40150fc-7574-42ca-a30e-efedf3cfbfc0&amp;amp;searchIndex=0"&gt;https://community.esri.com/community/developers/gis-developers/python?sr=search&amp;amp;searchId=f40150fc-7574-42ca-a30e-efedf3cfbfc0&amp;amp;searchIndex=0&lt;/A&gt;‌.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2017 17:27:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-automate-zip-codes-help/m-p/457517#M35940</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-06-20T17:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Automate Zip Codes Help</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-automate-zip-codes-help/m-p/457518#M35941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In addition to the solution provided by&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/3420"&gt;Joshua Bixby&lt;/A&gt;&amp;nbsp;, you can find some more examples of doing this in&amp;nbsp;&lt;A href="https://community.esri.com/docs/DOC-1927"&gt;Some Python Snippets&lt;/A&gt;&amp;nbsp;(see the part of&amp;nbsp;Formatting leading zero's in General Snippets).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2017 18:25:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-automate-zip-codes-help/m-p/457518#M35941</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2017-06-20T18:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Python Script to Automate Zip Codes Help</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-automate-zip-codes-help/m-p/457519#M35942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then there is the blogs on &lt;A _jive_internal="true" href="https://community.esri.com/blogs/dan_patterson/2016/03/01/basic-fancy-formats"&gt;Basic Fancy Formatting&lt;/A&gt;... with references to Fancy Fancy Formatting and a variety of other tips.&amp;nbsp; You can waste a whole day making stuff look nice without getting any meaningful work done... all the tips are there &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jun 2017 18:34:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-automate-zip-codes-help/m-p/457519#M35942</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-06-20T18:34:28Z</dc:date>
    </item>
  </channel>
</rss>

