0

I am copying table from source to target. But some of the records of the rows are getting blank in the copied table. My environment ArcGIS Pro 2.x. My script is :

def CopyTables(self, sourceWorkspace,targetworkspace):
       arcpy.env.workspace=sourceWorkspace
       sourceTableList=arcpy.ListTables()
       self.Total = len(sourceTableList)
       self.Count=0
       arcpy.SetProgressor("Setp", "{0}/{1}".format(self.Count, self.Total), 0, self.Total, 1)
       for sourceTable in sourceTableList:
          self.Count+=1          
          arcpy.SetProgressorLabel("Creating table {0} {1}/{2}".format(sourceTable,self.Count, self.Total))   
          arcpy.Copy_management(os.path.join(sourceWorkspace,sourceTable),os.path.join(targetworkspace,sourceTable))
          arcpy.AddMessage("Created table {0} at {1}".format(sourceTable,targetworkspace))
          

Any idea why this is happening?

3
  • 1
    Is this good enough?
    – Rpandia31
    Feb 16 at 12:37
  • According to PEP8, you can use any indent scheme you want, so long as you want to use 4 spaces. Six then three is going to distract any developer who looks at your code.
    – Vince
    Feb 16 at 13:04
  • This shouldn't be happening with arcpy.Copy_management tool. This tool copies the source item, thus no selections or anything like that. It basically does a 1:1 copy. I couldn't guess why it would be dropping attributes (blank rows). You could get the messages and print them from the copy tool to see if there are any warnings about something gone wrong. r = arcpy.Copy_management(...) >> print(r.getMessages())
    – KHibma
    Feb 16 at 14:16

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.