<?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 Automating Metadata Importing in Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/automating-metadata-importing-in-python/m-p/146926#M11456</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to automate importing metadata in Arc Catalog. I want to run this script to use a template for each feature class within a geodatabase. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error I get in my script is ERROR 000816: The tool is not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not quite sure where I have went wrong in this. Here is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;

import arcpy
#imports the python library into the Arc systems

arcpy.env.workspace = "C:\Users\hallle\Documents\Lin_Metadata\Metadata.gdb"
#sets the workspace that will be used for the script

#arcpy.ImportMetadata_conversion("C:\Users\hallle\Documents\Lin_Metadata\Template.xml","FROM_ISO_19139","Active_Gas_Main")
#imports the metadata template into the desired file

cname = open("C:\Users\hallle\Documents\Lin_Metadata\classnames.txt",'r')
n = 0

for line in cname:
&amp;nbsp;&amp;nbsp; print line
&amp;nbsp;&amp;nbsp; arcpy.ImportMetadata_conversion("C:\Users\hallle\Documents\Lin_Metadata\Template.xml","FROM_ISO_19139","C:\Users\hallle\Documents\Lin_Metadata\classnames.txt")
&amp;nbsp;&amp;nbsp; print 'The name of the file is ' (r)
&amp;nbsp;&amp;nbsp; n = n + 1

print 'Done'

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, the two commented lines of code with an import metadata conversion was just there for debugging.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Oct 2013 17:08:42 GMT</pubDate>
    <dc:creator>LinHall</dc:creator>
    <dc:date>2013-10-18T17:08:42Z</dc:date>
    <item>
      <title>Automating Metadata Importing in Python</title>
      <link>https://community.esri.com/t5/python-questions/automating-metadata-importing-in-python/m-p/146926#M11456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to automate importing metadata in Arc Catalog. I want to run this script to use a template for each feature class within a geodatabase. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error I get in my script is ERROR 000816: The tool is not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not quite sure where I have went wrong in this. Here is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;

import arcpy
#imports the python library into the Arc systems

arcpy.env.workspace = "C:\Users\hallle\Documents\Lin_Metadata\Metadata.gdb"
#sets the workspace that will be used for the script

#arcpy.ImportMetadata_conversion("C:\Users\hallle\Documents\Lin_Metadata\Template.xml","FROM_ISO_19139","Active_Gas_Main")
#imports the metadata template into the desired file

cname = open("C:\Users\hallle\Documents\Lin_Metadata\classnames.txt",'r')
n = 0

for line in cname:
&amp;nbsp;&amp;nbsp; print line
&amp;nbsp;&amp;nbsp; arcpy.ImportMetadata_conversion("C:\Users\hallle\Documents\Lin_Metadata\Template.xml","FROM_ISO_19139","C:\Users\hallle\Documents\Lin_Metadata\classnames.txt")
&amp;nbsp;&amp;nbsp; print 'The name of the file is ' (r)
&amp;nbsp;&amp;nbsp; n = n + 1

print 'Done'

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, the two commented lines of code with an import metadata conversion was just there for debugging.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2013 17:08:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/automating-metadata-importing-in-python/m-p/146926#M11456</guid>
      <dc:creator>LinHall</dc:creator>
      <dc:date>2013-10-18T17:08:42Z</dc:date>
    </item>
  </channel>
</rss>

