Hello everyone
How to reorder fields in a feature class with model builder?
Thanks
It would be nice if the arrows on the Feature Class to Feature Class tool actually did what they look like they're supposed to do.
Creating a new...or overwriting an old...is the only way to do it with the methods listed above. Should want to incorporate scripting in your model, reordering fields in NumPy arrays is trivial. See NumPyArrayToFeatureClass and FeatureClassToNumPyArray in the help plus others. For an example see Before I forget ... # 3 ... Doing stuff with tabular data in array form
Greetings Jose,
A while back I developed a custom script tool which could be used in ModelBuilder to reorder the fields in a shapefile. The tool uses the GDAL/OGR library from OSGeo4W.
If you are interested in diving in to custom Python script tools and open source, let me know and I can share my script.
Micah
I don't think there is a tool available that does specifically this without creating a new feature class. If I need to accomplish this without creating a new feature class I use python to drop and re-add the fields in the needed order. If its okay to create a new feature class I tend to manipulate a fieldmappings object to specify my needed field order in the newly create feature and then append the previous data into it.
ArcGIS Idea to add this functionality
http://ideas.arcgis.com/ideaView?id=0873000000087wgAAA
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.