<?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 Problem with Importing Exchange files while using an infile loop in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/problem-with-importing-exchange-files-while-using/m-p/318849#M24796</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi! I have a python script that's supposed to walk through a directory and convert any e00 files, while renaming them with a date/time stamp. The following code works:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Import arcpy module
import arcpy

# Local variables:
q3710583_e00 = "C:\\Data\\ExchangeFiles\\q3710583.e00"
ExchangeFiles = "C:\\Data\\ExchangeFiles"

# Process: Import from E00
arcpy.ImportFromE00_conversion(q3710583_e00, ExchangeFiles, "q37105830")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The following code does NOT work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, os, ctypes, datetime

workspace="C:\\Data\\ExchangeFiles"

now=datetime.datetime.now()
count = 0
for infile in os.listdir(workspace):
&amp;nbsp;&amp;nbsp;&amp;nbsp; fileName, fileExtension = os.path.splitext(infile)
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (fileExtension == '.e00'):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ImportFromE00_conversion(infile, workspace, "exchangeFile"+str(now.month)+"."+str(now.day)+"."+str(now.year))
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count += 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print str(count) + " files not converted"
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I feel that the &lt;/SPAN&gt;&lt;STRONG&gt;for&lt;/STRONG&gt;&lt;SPAN&gt; loop is working, but the arcpy conversion fails every time with the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; File "C:/PythonScripts/WalkE00ThroughFolder.py", line 12, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; arcpy.ImportFromE00_conversion(infile, workspace, "exchangeFile"+str(now.month)+"."+str(now.day)+"."+str(now.year))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 1054, in ImportFromE00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; raise e&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000732: Input interchange file: Dataset q3710583.e00 does not exist or is not supported&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (ImportFromE00). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is nothing in my test folder except three e00 files, and I made sure to delete any extraneous files before attempting to run the code. If there is a better way to search through a folder and pull out specific files for conversion, I'm all ears! Or if there's something simply wrong in my code, I'd love to have someone tell me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Ben S.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:20:21 GMT</pubDate>
    <dc:creator>BenSloboda</dc:creator>
    <dc:date>2021-12-12T16:20:21Z</dc:date>
    <item>
      <title>Problem with Importing Exchange files while using an infile loop</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-importing-exchange-files-while-using/m-p/318849#M24796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi! I have a python script that's supposed to walk through a directory and convert any e00 files, while renaming them with a date/time stamp. The following code works:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# Import arcpy module
import arcpy

# Local variables:
q3710583_e00 = "C:\\Data\\ExchangeFiles\\q3710583.e00"
ExchangeFiles = "C:\\Data\\ExchangeFiles"

# Process: Import from E00
arcpy.ImportFromE00_conversion(q3710583_e00, ExchangeFiles, "q37105830")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The following code does NOT work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, os, ctypes, datetime

workspace="C:\\Data\\ExchangeFiles"

now=datetime.datetime.now()
count = 0
for infile in os.listdir(workspace):
&amp;nbsp;&amp;nbsp;&amp;nbsp; fileName, fileExtension = os.path.splitext(infile)
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (fileExtension == '.e00'):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ImportFromE00_conversion(infile, workspace, "exchangeFile"+str(now.month)+"."+str(now.day)+"."+str(now.year))
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count += 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print str(count) + " files not converted"
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I feel that the &lt;/SPAN&gt;&lt;STRONG&gt;for&lt;/STRONG&gt;&lt;SPAN&gt; loop is working, but the arcpy conversion fails every time with the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; File "C:/PythonScripts/WalkE00ThroughFolder.py", line 12, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; arcpy.ImportFromE00_conversion(infile, workspace, "exchangeFile"+str(now.month)+"."+str(now.day)+"."+str(now.year))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 1054, in ImportFromE00&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; raise e&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000732: Input interchange file: Dataset q3710583.e00 does not exist or is not supported&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (ImportFromE00). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is nothing in my test folder except three e00 files, and I made sure to delete any extraneous files before attempting to run the code. If there is a better way to search through a folder and pull out specific files for conversion, I'm all ears! Or if there's something simply wrong in my code, I'd love to have someone tell me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Ben S.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:20:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-importing-exchange-files-while-using/m-p/318849#M24796</guid>
      <dc:creator>BenSloboda</dc:creator>
      <dc:date>2021-12-12T16:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Importing Exchange files while using an infile loop</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-importing-exchange-files-while-using/m-p/318850#M24797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You have a couple problems.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Coverage names cannot be over 13 characters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) the infile parameter does not reference workspaces, it must be a full path&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Read this for more information.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://support.esri.com/en/knowledgebase/techarticles/detail/21052"&gt;http://support.esri.com/en/knowledgebase/techarticles/detail/21052&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 17:02:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-importing-exchange-files-while-using/m-p/318850#M24797</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-05-16T17:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Importing Exchange files while using an infile loop</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-importing-exchange-files-while-using/m-p/318851#M24798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's true!&amp;nbsp; The file name was too long for the output file, and the input file needed to be modified to include the full path.&amp;nbsp; See below for success story, and thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, os, ctypes, datetime

workspace="C:\\Data\\ExchangeFiles"

now=datetime.datetime.now()
count = 0
for infile in os.listdir(workspace):
&amp;nbsp;&amp;nbsp;&amp;nbsp; fileName, fileExtension = os.path.splitext(infile)
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (fileExtension == '.e00'):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ImportFromE00_conversion(workspace +"\\"+ infile, workspace, fileName+"xxx")
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count += 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print str(count)+" files not converted"
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
box = ctypes.windll.user32.MessageBoxW
box(0, u'This script finished running at '+str(now), u"Success!", 0)
print "This script is finished running"


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:09:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-importing-exchange-files-while-using/m-p/318851#M24798</guid>
      <dc:creator>BenSloboda</dc:creator>
      <dc:date>2021-12-11T15:09:22Z</dc:date>
    </item>
  </channel>
</rss>

