Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Natural sort or Alphanumeric sort algorithm

Posted on 2011-02-20
6
Medium Priority
?
957 Views
Last Modified: 2013-12-18
Hi

Has anyone worked on Natural Sorting or Alphanumeric sorting of given list. I am planning to write a lotus script code for this, but would like to know the algorithm or technique for such a sort.


Regards
Javed Khan
0
Comment
Question by:javakthar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 34940420
Just use merge sort or insertion sort or whatever your favorite standard sorting algorithm.
The only extra thing you need to do is to write your own less than function. Just parse the string and if you see a number, count the digits first (or extract them, convert to integer and compare).
0
 
LVL 22

Expert Comment

by:mbonaci
ID: 34941170
You can use QuickSort/InsertionSort (balanced combination) located in your mail db > form Group > action "Sort members list" calls > QuickSort in form's Globals
0
 

Accepted Solution

by:
javakthar earned 0 total points
ID: 34958305
I referred to Dave Koells Algorithm for Alphanumeric Sorting and have created a similar functionality in Lotus Script, with some changes. With this i am now able to do the required alphanumeric sorting.

Any facing similar problem can get in touch with me for the code.
0
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
LVL 22

Expert Comment

by:mbonaci
ID: 34958880
If you want to publish the code you can do that here and/or (even better) on openNTF.
I'm sure it'll be of good use to someone.
0
 

Author Comment

by:javakthar
ID: 34985349
Here is the alphanumeri comparison code.  This can be used in any of the sorting methods such as quick sort , selection sort or any other.

This code can be inroduced at the point where the comparison is being done.

I could not access this site for couple of days, hence the delay.
Alphanum.txt
0
 

Author Closing Comment

by:javakthar
ID: 34990909
There are various scenarios for testing the complete functioning of alphanumeric sorts. My code works well in the scenarios which i have tested so far. It could fail in some unknown scenarios.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question