<?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: Arcpy copy feature out of path in a table? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414127#M32621</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I changed it over to a questions (Actions &amp;gt; Convert to Question). I'll add in some documentation to our &lt;A href="https://community.esri.com/space/2004"&gt;Community Help&lt;/A&gt; on how to do this. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Apr 2016 11:31:27 GMT</pubDate>
    <dc:creator>TimothyHales</dc:creator>
    <dc:date>2016-04-12T11:31:27Z</dc:date>
    <item>
      <title>Arcpy copy feature out of path in a table?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414117#M32611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've a table with paths like:&lt;/P&gt;&lt;P&gt;R:\Daten\geo_daten\GEOLOGIE\bodenuebersicht\daten\arcview\bodeneigenschaften\shape\bodeneigenschaften.shp&lt;/P&gt;&lt;P&gt;and want to copy this Feature somewhere else and delete in the location where it is?&lt;/P&gt;&lt;P&gt;What's wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, numpy
arcpy.env.overwriteOutput = True
InPath = r"R:\Karto\Geodaten_Archiv.txt"
OutPath = r"R:\Daten\geo_daten\geodaten_archiv\SIC_2016_04_07"
filename = open(InPath, 'r')
arr = arcpy.da.TableToNumPyArray(InPath, "Datenpfad")
for line in arr:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print line
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(line, OutPath)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:46:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414117#M32611</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2021-12-11T18:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy copy feature out of path in a table?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414118#M32612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you use print line in 8 what do you get. ON line 9 you are coping whatever is printed on line 8 but you are printing to the same name over and over. I didn't test this but you may need to do something similar to below&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

import arcpy, numpy ,os 
arcpy.env.overwriteOutput = True&amp;nbsp; 
InPath = r"R:\Karto\Geodaten_Archiv.txt"&amp;nbsp; 
OutPath = r"R:\Daten\geo_daten\geodaten_archiv\SIC_2016_04_07"&amp;nbsp; 
filename = open(InPath, 'r')&amp;nbsp; #Not being used
arr = arcpy.da.TableToNumPyArray(InPath, "Datenpfad")&amp;nbsp; 
for line in arr:&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; print line&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(line, os.path.join(OutPath,os.path.basename(line)))&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:46:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414118#M32612</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2021-12-11T18:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy copy feature out of path in a table?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414119#M32613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your comment, but your idea leads to this:&lt;/P&gt;&lt;P&gt;(u'R:\\Daten\\geo_daten\\GEOLOGIE\\bodenuebersicht\\daten\\arcview\\bodeneigenschaften\\shape\\bodeneigenschaften.shp',)&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(line, os.path.join(OutPath,os.path.basename(line)))&lt;BR /&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\ntpath.py", line 198, in basename&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return split(p)[1]&lt;BR /&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\ntpath.py", line 170, in split&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; d, p = splitdrive(p)&lt;BR /&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\ntpath.py", line 125, in splitdrive&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if p[1:2] == ':':&lt;BR /&gt;IndexError: invalid index&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2016 13:01:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414119#M32613</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2016-04-11T13:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy copy feature out of path in a table?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414120#M32614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What prints on line 8?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2016 13:20:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414120#M32614</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2016-04-11T13:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy copy feature out of path in a table?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414121#M32615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You originally said this ( see my comments in &lt;SPAN style="color: #e23d39;"&gt;red&lt;/SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; "&lt;/P&gt;&lt;P&gt;I've a table with paths like:&lt;/P&gt;&lt;P&gt;R:\Daten\geo_daten\GEOLOGIE\bodenuebersicht\daten\arcview\bodeneigenschaften\shape\bodeneigenschaften.shp&lt;/P&gt;&lt;P&gt;and want to copy this Feature somewhere else and delete in the location where it is?&lt;/P&gt;&lt;P&gt;What's wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="dp-highlighter"&gt;&lt;DIV class="bar"&gt;&lt;P&gt;&lt;/P&gt;&lt;OL class="dp-py"&gt;&lt;LI&gt;&lt;SPAN class="keyword"&gt;import arcpy, numpy&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;arcpy.env.overwriteOutput = &lt;SPAN class="special"&gt;True&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;InPath = r&lt;SPAN class="string"&gt;"R:\Karto\Geodaten_Archiv.txt"&amp;nbsp; &lt;SPAN style="color: #e23d39;"&gt;# This isn't a path, it is a file&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;OutPath = r&lt;SPAN class="string"&gt;"R:\Daten\geo_daten\geodaten_archiv\SIC_2016_04_07"&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;filename = open(InPath, &lt;SPAN class="string"&gt;'r')&amp;nbsp; &lt;SPAN style="color: #e23d39;"&gt;# not using this&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;arr = arcpy.da.TableToNumPyArray(InPath, &lt;SPAN class="string"&gt;"Datenpfad")&amp;nbsp; &lt;SPAN style="color: #e23d39;"&gt;# why are you converting to a numpy array ???&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="keyword"&gt;for line &lt;SPAN class="keyword"&gt;in&lt;/SPAN&gt; arr:&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword"&gt;print line&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(line, OutPath) &lt;SPAN style="color: #e23d39;"&gt;# there is no file specified&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you point to a shapefile : R:\Daten\geo_daten\GEOLOGIE\bodenuebersicht\daten\arcview\bodeneigenschaften\shape\bodeneigenschaften.shp&lt;/P&gt;&lt;P&gt;Then you read from a text file in your code???&lt;/P&gt;&lt;P&gt;If you just want to copy a bunch of shapefiles from one location to the other, you could do something like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import sys, os, arcpy
inPath = "some path here"
outPath = "some other path here"
arcpy.env.workspace = inPath
shpIn = [for f in arcpy.ListFeatureClasses() if f.endswith(".shp")]

for shp in shpIn:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(shp, os.path.join(outPath, shp))&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All this, more or less from :&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/copy-features.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/copy-features.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Copy Features—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:46:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414121#M32615</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2021-12-11T18:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy copy feature out of path in a table?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414122#M32616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Forgot it was an array, see if this works&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, numpy ,os&amp;nbsp;&amp;nbsp; 
arcpy.env.overwriteOutput = True&amp;nbsp;&amp;nbsp;&amp;nbsp; 
InPath = r"F:\Departments\GIS\Wes\PySripts\DanPatterson\Code4GeoNet\CopyTest\Paths.txt"&amp;nbsp;&amp;nbsp;&amp;nbsp; 
OutPath = r"F:\Departments\GIS\Wes\PySripts\DanPatterson\Code4GeoNet\CopyTest\CopyTo"&amp;nbsp; 
filename = open(InPath, 'r')&amp;nbsp; #Not being used&amp;nbsp; 
arr = arcpy.da.TableToNumPyArray(InPath, "Datenpfad")&amp;nbsp;&amp;nbsp;&amp;nbsp; 
for line in arr:&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; print line[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp; print os.path.join(OutPath,os.path.basename(line))
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(line[0], os.path.join(OutPath,os.path.basename(line[0]))) &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:46:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414122#M32616</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2021-12-11T18:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy copy feature out of path in a table?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414123#M32617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If that works here is the &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/delete.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/delete.htm"&gt;Delete—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp; help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2016 13:40:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414123#M32617</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2016-04-11T13:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy copy feature out of path in a table?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414124#M32618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;line[0] was it, thanks a lot&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2016 14:09:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414124#M32618</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2016-04-11T14:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy copy feature out of path in a table?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414125#M32619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would like to mark your answer as the correct one, but there's only helpful and like buttons. Sorry wasn't here for a long time?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2016 14:16:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414125#M32619</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2016-04-11T14:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy copy feature out of path in a table?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414126#M32620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Johannes,&lt;/P&gt;&lt;P&gt;See if you can still change this from a "discussion" to a "question", then you should be able to check a correct answer.&amp;nbsp; &lt;A href="https://community.esri.com/migrated-users/2034"&gt;Timothy Hales&lt;/A&gt;​ can probably help if you aren't able to do this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2016 18:22:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414126#M32620</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-04-11T18:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy copy feature out of path in a table?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414127#M32621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I changed it over to a questions (Actions &amp;gt; Convert to Question). I'll add in some documentation to our &lt;A href="https://community.esri.com/space/2004"&gt;Community Help&lt;/A&gt; on how to do this. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Apr 2016 11:31:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414127#M32621</guid>
      <dc:creator>TimothyHales</dc:creator>
      <dc:date>2016-04-12T11:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy copy feature out of path in a table?</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414128#M32622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Timothy.&amp;nbsp; That would be a good topic to add.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/47947"&gt;Johannes Bierer&lt;/A&gt; ...now you can mark one of the comments as "the answer", and if you haven't already, mark those that helped you as "helpful"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Apr 2016 15:03:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-copy-feature-out-of-path-in-a-table/m-p/414128#M32622</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-04-12T15:03:46Z</dc:date>
    </item>
  </channel>
</rss>

