import arcpy
import os
table = r'the location to the geodatabase table I wish to populate'
arcpy.env.workspace = r'the folder path to my jpgs'
for jpeg in arcpy.ListFiles("*.jpg"):
output = os.path.splitext(jpeg)[0]
print ouput
arcpy.CopyRows_management(output, table)
Hello,
I am trying to loop through a folder that contains 500+ JPGs and copy their names to a geodatabase table. I am able to successfully get to line 9 in my example code above and print all of my JPG names. However, when I get to line 10, I am unable to successfully copy these names to a new geodatabase table. Would anyone have any suggestions?
Thanks in advance,
Craig
Solved! Go to Solution.
Take a look at insert cursor.
That did the trick. Thanks Joe!