<?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: Calculating Field in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/calculating-field/m-p/606585#M20146</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to make it a little more robust, but slightly more complex you could use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_1421971202440367" jivemacro_uid="_1421971202440367"&gt;&lt;P&gt;"{0}-{1}".format("{0}".format(int(!ACONTROL!)).zfill(4),"{0}".format(int(!ASECTION!)).zfill(2))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will yield:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="result2.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/53736_result2.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;as the first suggestion will yield:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="result1.png" class="jive-image image-2" src="https://community.esri.com/legacyfs/online/53737_result1.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Jan 2015 00:04:23 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2015-01-23T00:04:23Z</dc:date>
    <item>
      <title>Calculating Field</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculating-field/m-p/606583#M20144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have 2 fields I need to concatenate together and add zeros and a hypen. &lt;/P&gt;&lt;P&gt;For Example: 0001-02&lt;/P&gt;&lt;P&gt;In the past this code worked :&lt;/P&gt;&lt;P&gt;"00{0}-0{1}".format(int(!ACONTROL!)),int(!ASECTION!))&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This time I am getting an error of :&lt;/P&gt;&lt;P&gt;SyntaxError: unexpected EOF while parsing(&amp;lt;string&amp;gt;, line 1)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My empty field I created is a text. The AControl field is a double and the ASection field is a double.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why is my code not working this time? What have I changed? Please help. THanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 21:25:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculating-field/m-p/606583#M20144</guid>
      <dc:creator>MichelleCouden</dc:creator>
      <dc:date>2015-01-22T21:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Field</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculating-field/m-p/606584#M20145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is not something that is missing... you have a parenthesis too much:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1421970187526910 jive_text_macro" jivemacro_uid="_1421970187526910"&gt;&lt;P&gt;"00{0}-0{1}".format(int(!ACONTROL!),int(!ASECTION!))&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 23:43:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculating-field/m-p/606584#M20145</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-01-22T23:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Field</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculating-field/m-p/606585#M20146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to make it a little more robust, but slightly more complex you could use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_1421971202440367" jivemacro_uid="_1421971202440367"&gt;&lt;P&gt;"{0}-{1}".format("{0}".format(int(!ACONTROL!)).zfill(4),"{0}".format(int(!ASECTION!)).zfill(2))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will yield:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="result2.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/53736_result2.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;as the first suggestion will yield:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="result1.png" class="jive-image image-2" src="https://community.esri.com/legacyfs/online/53737_result1.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jan 2015 00:04:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculating-field/m-p/606585#M20146</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-01-23T00:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Field</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculating-field/m-p/606586#M20147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You xander for your help. The second code worked great!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2015 15:48:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculating-field/m-p/606586#M20147</guid>
      <dc:creator>MichelleCouden</dc:creator>
      <dc:date>2015-01-26T15:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Field</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculating-field/m-p/606587#M20148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad it worked!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2015 15:56:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculating-field/m-p/606587#M20148</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-01-26T15:56:29Z</dc:date>
    </item>
  </channel>
</rss>

