My feature class consists of several fields with name as Objectid,Objectid_1,objectid_2,objectid_12 due to spatialjoin and exporting.. I require only the recent object Id and delete all other fields..How to find and execute in arcpy!!!!
You could guess OBJECTID, and likely be correct, but you can find out definitively by using the ArcPy Describe object:
<SPAN class="operator token">>></SPAN><SPAN class="operator token">></SPAN> table <SPAN class="operator token">=</SPAN> <SPAN class="comment token"># table or feature class</SPAN> <SPAN class="operator token">>></SPAN><SPAN class="operator token">></SPAN> desc <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Describe<SPAN class="punctuation token">(</SPAN>table<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">>></SPAN><SPAN class="operator token">></SPAN> desc<SPAN class="punctuation token">.</SPAN>OIDFieldName u<SPAN class="string token">'OBJECTID'</SPAN> <SPAN class="operator token">>></SPAN><SPAN class="operator token">></SPAN> <SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.