Post Reply 
Sorting Strings
07-10-2017, 07:22 AM
Post: #3
RE: Sorting Strings
(07-10-2017 04:58 AM)webmasterpdx Wrote:  Have you tried to use the SORT command with a list of strings? ...
Sure looks like it works to me....???

Ordinary "alphabetical" sorting is not what Jacob is asking for. He wants so-called "natural sorting" of numbers inside strings. Example: right now, SORT({"1", "2", "11", "22"}) returns {"1", "11", "2", "22"} which is correctly alphabetized but is NOT the correct numerical order which is what is being sought here, namely, {"1", "2", "11", "22"}.

Jacob, it's unclear to me what kinds of inputs you want to handle. If the strings contain only digits, it's an easy task (just convert the whole list to numbers, sort them, then convert back to strings). Or do you want inputs like the example in your linked article, with digits mixed with non-digit characters? If the latter, will the digits have to be hunted for? Specific examples would help.

<0|ΙΈ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Sorting Strings - Jacob Wall - 07-10-2017, 12:18 AM
RE: Sorting Strings - webmasterpdx - 07-10-2017, 04:58 AM
RE: Sorting Strings - Joe Horn - 07-10-2017 07:22 AM
RE: Sorting Strings - Jacob Wall - 07-10-2017, 05:02 PM
RE: Sorting Strings - Tyann - 07-11-2017, 05:03 AM
RE: Sorting Strings - Tyann - 07-11-2017, 06:06 PM
RE: Sorting Strings - Jacob Wall - 07-11-2017, 06:21 PM
RE: Sorting Strings - Didier Lachieze - 07-11-2017, 11:32 PM
RE: Sorting Strings - Gilles59 - 07-12-2017, 08:28 PM
RE: Sorting Strings - Han - 07-12-2017, 12:32 AM
RE: Sorting Strings - Jacob Wall - 07-12-2017, 05:10 AM
RE: Sorting Strings - Jacob Wall - 07-14-2017, 07:02 AM
RE: Sorting Strings - Didier Lachieze - 07-14-2017, 08:11 AM
RE: Sorting Strings - Jacob Wall - 07-15-2017, 03:00 AM



User(s) browsing this thread: 4 Guest(s)