<?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 trimming character from Output Feature Class in Feature class to feature class conver in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/trimming-character-from-output-feature-class-in/m-p/460357#M36041</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to use arcpy.FeatureClassToFeatureClass_conversion to move feature classes from one gdb to another. I would like to trim the first 16 characters from the feature class name. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;how do i do this? this is how i have it set up with of course the ????? being where i am unsure.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Set Workspace&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;env.workspace = r"Database Connections\GENERAL_DATA - PROD.sde"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# List Feature Classes&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fcList = arcpy.ListFeatureClasses ("MGISP.GISONEAST*")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Loop through each feature class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for fc in fcList:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; # move features from sde to gis01&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; arcpy.FeatureClassToFeatureClass_conversion (fc, output_folder + "\\" + my_dir + "\\" + my_gdb, ???????? , "")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Oct 2012 17:27:35 GMT</pubDate>
    <dc:creator>LouisEarly</dc:creator>
    <dc:date>2012-10-11T17:27:35Z</dc:date>
    <item>
      <title>trimming character from Output Feature Class in Feature class to feature class conver</title>
      <link>https://community.esri.com/t5/python-questions/trimming-character-from-output-feature-class-in/m-p/460357#M36041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to use arcpy.FeatureClassToFeatureClass_conversion to move feature classes from one gdb to another. I would like to trim the first 16 characters from the feature class name. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;how do i do this? this is how i have it set up with of course the ????? being where i am unsure.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Set Workspace&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;env.workspace = r"Database Connections\GENERAL_DATA - PROD.sde"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# List Feature Classes&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fcList = arcpy.ListFeatureClasses ("MGISP.GISONEAST*")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Loop through each feature class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for fc in fcList:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; # move features from sde to gis01&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; arcpy.FeatureClassToFeatureClass_conversion (fc, output_folder + "\\" + my_dir + "\\" + my_gdb, ???????? , "")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2012 17:27:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trimming-character-from-output-feature-class-in/m-p/460357#M36041</guid>
      <dc:creator>LouisEarly</dc:creator>
      <dc:date>2012-10-11T17:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: trimming character from Output Feature Class in Feature class to feature class co</title>
      <link>https://community.esri.com/t5/python-questions/trimming-character-from-output-feature-class-in/m-p/460358#M36042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Something like this should work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
import os

# Set Workspace
env.workspace = r"Database Connections\GENERAL_DATA - PROD.sde"

# List Feature Classes
fcList = arcpy.ListFeatureClasses("MGISP.GISONEAST*")

# Loop through each feature class
for fc in fcList:

&amp;nbsp;&amp;nbsp;&amp;nbsp; # move features from sde to gis01
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.FeatureClassToFeatureClass_conversion(fc, os.path.join(output_folder, my_dir, my_gdb),&lt;STRONG&gt; fc[16:]&lt;/STRONG&gt;, "")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could also do something like this, depending on your situation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;fc.lstrip("MGISP.GISONEAST")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:29:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trimming-character-from-output-feature-class-in/m-p/460358#M36042</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-11T20:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: trimming character from Output Feature Class in Feature class to feature class co</title>
      <link>https://community.esri.com/t5/python-questions/trimming-character-from-output-feature-class-in/m-p/460359#M36043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, that was it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2012 18:14:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/trimming-character-from-output-feature-class-in/m-p/460359#M36043</guid>
      <dc:creator>LouisEarly</dc:creator>
      <dc:date>2012-10-11T18:14:40Z</dc:date>
    </item>
  </channel>
</rss>

