<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="keyword token">import</SPAN> os
table <SPAN class="operator token">=</SPAN> r<SPAN class="string token">'the location to the geodatabase table I wish to populate'</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace <SPAN class="operator token">=</SPAN> r<SPAN class="string token">'the folder path to my jpgs'</SPAN>
<SPAN class="keyword token">for</SPAN> jpeg <SPAN class="keyword token">in</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>ListFiles<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"*.jpg"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
output <SPAN class="operator token">=</SPAN> os<SPAN class="punctuation token">.</SPAN>path<SPAN class="punctuation token">.</SPAN>splitext<SPAN class="punctuation token">(</SPAN>jpeg<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">print</SPAN> ouput
arcpy<SPAN class="punctuation token">.</SPAN>CopyRows_management<SPAN class="punctuation token">(</SPAN>output<SPAN class="punctuation token">,</SPAN> table<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
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