Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Natural Sorting

$
0
0
Is there a way to perform a natural sort on a SearchCursor? I've got a line of code:

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.

Viewing all articles
Browse latest Browse all 2485

Trending Articles