Free Support Forum - aspose.com

Natural sort with aspose

Natural sort with aspose? I have an excel column that contains alphanumeric data such as A11,A2,A9, A10. Issue is that an ascending sort provides the output A10, A11, A2, A9 . How do we obtain a natural sort with the expected output A2, A9, A10, A11 ?

@MariaJess,

Thanks for your query.

Well, this (the result) is default MS Excel’s behavior for data sorting, you may confirm it in MS Excel (the data is sorted based on ascii code/value for alpha-numeric data). I think you may try using custom lists for your customized data sorting. See the document with example for your reference:
https://docs.aspose.com/display/cellsnet/Sort+Data+in+Column+with+Custom+Sort+List

See the sample line of code for your reference:
i.e.,

//Create Custom Sort list
string[] customSortList = new string[] { “A2”, “A9”, “A10”, “A11” };