<?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 append field.length(254) to field.length(25) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-script-to-append-field-length-254-to-field/m-p/314122#M24414</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can we assume you have tried it and it fails with some error message&lt;/P&gt;&lt;P&gt;did you also try to fix the situation by adding a new field to the 25 char table and make it the right size, followed by a simple field calculation to bring over the values into the new field?&amp;nbsp; Then dump the short width field and use the new field in the append.&lt;/P&gt;&lt;P&gt;Any information on what you have tried and what their results were would be useful, since there are obvious workarounds.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Sep 2017 14:04:09 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2017-09-28T14:04:09Z</dc:date>
    <item>
      <title>Python script to append field.length(254) to field.length(25)</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-append-field-length-254-to-field/m-p/314121#M24413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Need a python script to help with an Append.&lt;/P&gt;&lt;P&gt;My input field length is 254 and my output field length is 25.&lt;/P&gt;&lt;P&gt;So I want the script to still append the data to the new field but can cut it off when it reaches 25 characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the anyway to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample of my script:&lt;/P&gt;&lt;P&gt;import arcpy, sys, os&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;# Arguments&lt;BR /&gt;input_data = arcpy.GetParameterAsText(0)&lt;BR /&gt;template = arcpy.GetParameterAsText(1)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;arcpy.Append_management(input_data,template,"NO_TEST", "", "")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this gives me the error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Sep 2017 13:42:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-append-field-length-254-to-field/m-p/314121#M24413</guid>
      <dc:creator>RowenWichtmann</dc:creator>
      <dc:date>2017-09-28T13:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Python script to append field.length(254) to field.length(25)</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-append-field-length-254-to-field/m-p/314122#M24414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can we assume you have tried it and it fails with some error message&lt;/P&gt;&lt;P&gt;did you also try to fix the situation by adding a new field to the 25 char table and make it the right size, followed by a simple field calculation to bring over the values into the new field?&amp;nbsp; Then dump the short width field and use the new field in the append.&lt;/P&gt;&lt;P&gt;Any information on what you have tried and what their results were would be useful, since there are obvious workarounds.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Sep 2017 14:04:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-append-field-length-254-to-field/m-p/314122#M24414</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-09-28T14:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Python script to append field.length(254) to field.length(25)</title>
      <link>https://community.esri.com/t5/python-questions/python-script-to-append-field-length-254-to-field/m-p/314123#M24415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simply assigning the long field to the shorter field my yield errors or truncate in a way you don't want. The field calculation that Dan refers to could be as simple as (using Python syntax)&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt; !YourLongFieldName!&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;25&lt;/SPAN&gt;&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Sep 2017 12:56:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-script-to-append-field-length-254-to-field/m-p/314123#M24415</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2017-09-29T12:56:53Z</dc:date>
    </item>
  </channel>
</rss>

