<?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 How do I remove the first 15 characters in a field? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-do-i-remove-the-first-15-characters-in-a-field/m-p/187193#M14401</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone advise me on how to remove the first 15 characters in a field&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the following code&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
# Import system modules
import sys, string, os, arcgisscripting
# Create the Geoprocessor object
gp = arcgisscripting.create(9.3)
# Overwrite data
gp.OverwriteOutput = 1
# Allow fields not to be appended
gp.qualifiedFieldNames = "false"
# Local variables...
inputView = "Database Connections\\UNIFORM BIZTALK.sde\\UNI72LIVE.LLPG"
inputPoint = "Database Connections\\UNISDE on singapore 5155.sde\\UNISDELIVE.UFRM_BLPU_POINT"
featurePoint = "UFRM_BLPU_POINT_Layer"
llpgView = "GIS_LLPG_SOURCE_View"
SDELayer = "Database Connections\\CORPDATA.sde\\ESRIGIS.CORPDATA.BLPU_Property_Points_NEW"
try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Make Feature Layer...
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.MakeFeatureLayer_management(inputPoint, featurePoint, "", "", "KEYVAL KEYVAL VISIBLE NONE;UPRN UPRN VISIBLE NONE;CREATEDBY CREATEDBY VISIBLE NONE;MODIFIEDBY MODIFIEDBY VISIBLE NONE;DATE_CREATED DATE_CREATED VISIBLE NONE;DATE_MODIFIED DATE_MODIFIED VISIBLE NONE;STATUS STATUS VISIBLE NONE;TRANSACTION_TYPE TRANSACTION_TYPE VISIBLE NONE;SYMBOL SYMBOL VISIBLE NONE;X X VISIBLE NONE;Y Y VISIBLE NONE;LOGICAL_STATUS LOGICAL_STATUS VISIBLE NONE;ACCURACY ACCURACY VISIBLE NONE;ADDRESS ADDRESS VISIBLE NONE")
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "1 - Make BLPU points into a View - Complete"
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Make Table View...
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.MakeTableView_management(inputView, llpgView, "", "", "S_NAME S_NAME VISIBLE NONE;LOCALITY_NAME LOCALITY_NAME VISIBLE NONE;TOWN_NAME TOWN_NAME VISIBLE NONE;COUNTY_NAME COUNTY_NAME VISIBLE NONE;START_NO START_NO VISIBLE NONE;START_SFX START_SFX VISIBLE NONE;END_NO END_NO VISIBLE NONE;END_SFX END_SFX VISIBLE NONE;DESCRPT DESCRPT VISIBLE NONE;SO_START_NO SO_START_NO VISIBLE NONE;SO_START_SFX SO_START_SFX VISIBLE NONE;SO_END_NO SO_END_NO VISIBLE NONE;SO_END_SFX SO_END_SFX VISIBLE NONE;SO_DESCRPT SO_DESCRPT VISIBLE NONE;POSTCODE POSTCODE VISIBLE NONE;POST_TOWN POST_TOWN VISIBLE NONE;ORGANISATION ORGANISATION VISIBLE NONE;UPDATED_D UPDATED_D VISIBLE NONE;BLPU_CLASS BLPU_CLASS VISIBLE NONE;BLPU_CLASS_DESC BLPU_CLASS_DESC VISIBLE NONE;LOGICAL_STATUS LOGICAL_STATUS VISIBLE NONE;UPRN UPRN VISIBLE NONE")
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "2 - Make LLPG into a View - Complete"
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Add Join...
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddJoin_management(featurePoint, "UPRN", llpgView, "UPRN", "KEEP_COMMON")
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "3 - Join Points to table - Complete"
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Delete Features...
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.DeleteFeatures_management(SDELayer)
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "4 - Delete the features in the SDE later - Complete"
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Append...
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.Append_management(featurePoint, SDELayer, "TEST", "", "")
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "5 - Append the updated BLPU to SDE layer - Complete"
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Done"
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Error has occured"
&amp;nbsp;&amp;nbsp;&amp;nbsp; print gp.getmessages()
 
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When the Add Join occurs, it calls the field UNI72LIVE_LLPG_BLPU_CLASS_DESC I just want the field to be called BLPU_CLASS_DESC, and i want this to occur for all the fields that have "UNI72LIVE_LLPG_" as part of the field name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone got any idea on how to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;halil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jul 2011 15:18:21 GMT</pubDate>
    <dc:creator>HalilSiddique</dc:creator>
    <dc:date>2011-07-25T15:18:21Z</dc:date>
    <item>
      <title>How do I remove the first 15 characters in a field?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-remove-the-first-15-characters-in-a-field/m-p/187193#M14401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone advise me on how to remove the first 15 characters in a field&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the following code&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
# Import system modules
import sys, string, os, arcgisscripting
# Create the Geoprocessor object
gp = arcgisscripting.create(9.3)
# Overwrite data
gp.OverwriteOutput = 1
# Allow fields not to be appended
gp.qualifiedFieldNames = "false"
# Local variables...
inputView = "Database Connections\\UNIFORM BIZTALK.sde\\UNI72LIVE.LLPG"
inputPoint = "Database Connections\\UNISDE on singapore 5155.sde\\UNISDELIVE.UFRM_BLPU_POINT"
featurePoint = "UFRM_BLPU_POINT_Layer"
llpgView = "GIS_LLPG_SOURCE_View"
SDELayer = "Database Connections\\CORPDATA.sde\\ESRIGIS.CORPDATA.BLPU_Property_Points_NEW"
try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Make Feature Layer...
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.MakeFeatureLayer_management(inputPoint, featurePoint, "", "", "KEYVAL KEYVAL VISIBLE NONE;UPRN UPRN VISIBLE NONE;CREATEDBY CREATEDBY VISIBLE NONE;MODIFIEDBY MODIFIEDBY VISIBLE NONE;DATE_CREATED DATE_CREATED VISIBLE NONE;DATE_MODIFIED DATE_MODIFIED VISIBLE NONE;STATUS STATUS VISIBLE NONE;TRANSACTION_TYPE TRANSACTION_TYPE VISIBLE NONE;SYMBOL SYMBOL VISIBLE NONE;X X VISIBLE NONE;Y Y VISIBLE NONE;LOGICAL_STATUS LOGICAL_STATUS VISIBLE NONE;ACCURACY ACCURACY VISIBLE NONE;ADDRESS ADDRESS VISIBLE NONE")
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "1 - Make BLPU points into a View - Complete"
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Make Table View...
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.MakeTableView_management(inputView, llpgView, "", "", "S_NAME S_NAME VISIBLE NONE;LOCALITY_NAME LOCALITY_NAME VISIBLE NONE;TOWN_NAME TOWN_NAME VISIBLE NONE;COUNTY_NAME COUNTY_NAME VISIBLE NONE;START_NO START_NO VISIBLE NONE;START_SFX START_SFX VISIBLE NONE;END_NO END_NO VISIBLE NONE;END_SFX END_SFX VISIBLE NONE;DESCRPT DESCRPT VISIBLE NONE;SO_START_NO SO_START_NO VISIBLE NONE;SO_START_SFX SO_START_SFX VISIBLE NONE;SO_END_NO SO_END_NO VISIBLE NONE;SO_END_SFX SO_END_SFX VISIBLE NONE;SO_DESCRPT SO_DESCRPT VISIBLE NONE;POSTCODE POSTCODE VISIBLE NONE;POST_TOWN POST_TOWN VISIBLE NONE;ORGANISATION ORGANISATION VISIBLE NONE;UPDATED_D UPDATED_D VISIBLE NONE;BLPU_CLASS BLPU_CLASS VISIBLE NONE;BLPU_CLASS_DESC BLPU_CLASS_DESC VISIBLE NONE;LOGICAL_STATUS LOGICAL_STATUS VISIBLE NONE;UPRN UPRN VISIBLE NONE")
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "2 - Make LLPG into a View - Complete"
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Add Join...
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddJoin_management(featurePoint, "UPRN", llpgView, "UPRN", "KEEP_COMMON")
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "3 - Join Points to table - Complete"
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Delete Features...
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.DeleteFeatures_management(SDELayer)
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "4 - Delete the features in the SDE later - Complete"
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Append...
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.Append_management(featurePoint, SDELayer, "TEST", "", "")
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "5 - Append the updated BLPU to SDE layer - Complete"
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Done"
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Error has occured"
&amp;nbsp;&amp;nbsp;&amp;nbsp; print gp.getmessages()
 
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When the Add Join occurs, it calls the field UNI72LIVE_LLPG_BLPU_CLASS_DESC I just want the field to be called BLPU_CLASS_DESC, and i want this to occur for all the fields that have "UNI72LIVE_LLPG_" as part of the field name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone got any idea on how to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;halil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2011 15:18:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-remove-the-first-15-characters-in-a-field/m-p/187193#M14401</guid>
      <dc:creator>HalilSiddique</dc:creator>
      <dc:date>2011-07-25T15:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove the first 15 characters in a field?</title>
      <link>https://community.esri.com/t5/python-questions/how-do-i-remove-the-first-15-characters-in-a-field/m-p/187194#M14402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In python, this is usually achieved through slicing. To keep all but the first X characters of a string, append &lt;X&gt; returns '67890'.&lt;/X&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Slicing is covered in the section on strings in the tutorial part of the Python documentation.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2011 15:56:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-do-i-remove-the-first-15-characters-in-a-field/m-p/187194#M14402</guid>
      <dc:creator>BruceNielsen</dc:creator>
      <dc:date>2011-07-25T15:56:06Z</dc:date>
    </item>
  </channel>
</rss>

