<?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: Load data (shp and features) out of multiple folders and subfolders in one FGDB in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334339#M26080</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I converted it to a question.&amp;nbsp; and will add a couple tags.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/47947"&gt;Johannes Bierer&lt;/A&gt; I also marked on of the answers as correct.&amp;nbsp; If that is not the one you wanted, you can unmark, and mark a different one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3420"&gt;Joshua Bixby&lt;/A&gt;&amp;nbsp; lol.&amp;nbsp; I'm not moderator on all, but this one I could do.&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Aug 2016 18:51:56 GMT</pubDate>
    <dc:creator>RebeccaStrauch__GISP</dc:creator>
    <dc:date>2016-08-08T18:51:56Z</dc:date>
    <item>
      <title>Load data (shp and features) out of multiple folders and subfolders in one FGDB</title>
      <link>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334332#M26073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;## Load Data

import arcpy
import os

workspace = r"R:\Daten\geo_daten_Kopie"
out_workspace = r"R:\Karto\Bierer2016\OrdnerRDatenGeodatenBereinigen\SIC_Geodaten.gdb\data"

import arcpy
import os

feature_classes = []
for dirpath, dirnames, filenames in arcpy.da.Walk(workspace, datatype="FeatureClass"): ##, type="Polygon"):
&amp;nbsp;&amp;nbsp;&amp;nbsp; for filename in filenames:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; feature_classes.append(os.path.join(dirpath, filename))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name = os.path.join(dirpath, filename)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print name
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BaseName = os.path.basename(name)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print BaseName
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BaseNameCopy = BaseName.split(".shp")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print BaseNameCopy
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(filename, os.path.join(out_workspace, BaseNameCopy))&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code leads to this error message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "H:/python_scripte/ListFolderandShapes/ListFeatures_FoldersSubfolders_CopyFeatures_3.py", line 22, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(filename, os.path.join(out_workspace, BaseNameCopy))&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\ntpath.py", line 73, in join&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif isabs(b):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\ntpath.py", line 58, in isabs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return s != '' and s[:1] in '/\\'&lt;/P&gt;&lt;P&gt;TypeError: 'in &amp;lt;string&amp;gt;' requires string as left operand, not list&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone has got an idea for a better solution?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:50:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334332#M26073</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2021-12-11T15:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Load data (shp and features) out of multiple folders and subfolders in one FGDB</title>
      <link>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334333#M26074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your output basename created after the split creates a list, so you need to access the first item of the list and not the entire list:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;BaseNameCopy = BaseName.split(&lt;SPAN class="string" style="font-weight: inherit; font-style: inherit; color: blue; font-size: 9pt !important; background-color: inherit;"&gt;".shp"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; color: #006699; font-size: 9pt !important;"&gt;print&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important;"&gt; BaseNameCopy[0]&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important;"&gt; arcpy.CopyFeatures_management(filename, os.path.join(out_workspace, BaseNameCopy[0]))&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:50:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334333#M26074</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2021-12-11T15:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: Load data (shp and features) out of multiple folders and subfolders in one FGDB</title>
      <link>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334334#M26075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please mark questions as questions, not discussions, so credit can be given for providing a correct answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 13:40:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334334#M26075</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-08-08T13:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: Load data (shp and features) out of multiple folders and subfolders in one FGDB</title>
      <link>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334335#M26076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah ok, didn't get this detail. Will post it again as a question. I think if FC Basson answers again the same he will get the points ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 13:45:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334335#M26076</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2016-08-08T13:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: Load data (shp and features) out of multiple folders and subfolders in one FGDB</title>
      <link>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334336#M26077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Double points for double work! &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 13:49:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334336#M26077</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2016-08-08T13:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Load data (shp and features) out of multiple folders and subfolders in one FGDB</title>
      <link>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334337#M26078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you still edit the discussion to mark it as a question?&amp;nbsp; I thought you were allowed to for a certain period of time after creating the discussion, but I may be mistaken.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 13:51:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334337#M26078</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-08-08T13:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Load data (shp and features) out of multiple folders and subfolders in one FGDB</title>
      <link>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334338#M26079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can't find the possibility to change a discussion to a question?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 13:56:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334338#M26079</guid>
      <dc:creator>JohannesBierer</dc:creator>
      <dc:date>2016-08-08T13:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Load data (shp and features) out of multiple folders and subfolders in one FGDB</title>
      <link>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334339#M26080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I converted it to a question.&amp;nbsp; and will add a couple tags.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/47947"&gt;Johannes Bierer&lt;/A&gt; I also marked on of the answers as correct.&amp;nbsp; If that is not the one you wanted, you can unmark, and mark a different one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3420"&gt;Joshua Bixby&lt;/A&gt;&amp;nbsp; lol.&amp;nbsp; I'm not moderator on all, but this one I could do.&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 18:51:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334339#M26080</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-08-08T18:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Load data (shp and features) out of multiple folders and subfolders in one FGDB</title>
      <link>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334340#M26081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great, next time I will just ping you. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 19:25:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/load-data-shp-and-features-out-of-multiple-folders/m-p/334340#M26081</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-08-08T19:25:10Z</dc:date>
    </item>
  </channel>
</rss>

