GEOlson86

Natural Sorting

Discussion created by GEOlson86 on Aug 20, 2013
Latest reply on Aug 21, 2013 by GEOlson86
Is there a way to perform a natural sort on a SearchCursor?  I've got a line of code:

rows = arcpy.SearchCursor(mapLyr, "", "", "CONCAT")


and I learned that it naturally sorts based on FID.  The "CONCAT" field is a text field but it always start with a number and a period (1., 2., 3., etc.).  So if I make it so it sort's by string, then I get 1., 10., 11., 2., etc.  I've found some python forums that refer to natural sorting, and I didn't know if ArcGIS had this built in.  Padding the numbers isn't an option because the field lists the description in the layout view.  Otherwise it will just be important to create features in the proper order.

Outcomes