Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 347901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:18:53+00:00 2026-05-12T11:18:53+00:00

What I would like to do is to sort a list of textual identifiers

  • 0

What I would like to do is to sort a list of textual identifiers (think of a file name for example). The sorting algorithm I’m looking for is a kind of alphabetic sorting, but taking groups into account.

For example, sorting “D1” to “D21” should be:

D1, D2, D3, …, D21

And not:

D1, D10, D11, D12, … D2, D20, D21, D3, …

I’ve been a lot of time trying to accomplish such way of sorting but still can’t find how to do it. The bigger the group the harder it seems.

Is there anyone that could guide me through or give me some pseudo code or code in any language?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:18:53+00:00Added an answer on May 12, 2026 at 11:18 am
    • Detect the position the strings differ first.
    • If both values at that position are numbers:
      • read forward, one character at at time, until you find a non-number in either string.
      • If only one string is non-numeric, it is “smaller”
      • If Both strings are non-numeric at the same point, compare numbers at the earlier detected position
    • Otherwise
      • compare alphabetically the letters at the position
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to be able to sort my contact list to retrieve the
After I move (sort) one of my list items I would like to know
I would like to sort my list with the date property. This is my
I would like to sort a list of strings which represent paths. The sort
If I have a list of elements I would like to sort, Java offers
I have a list of lists that I would like to sort. foreach (var
I have a list of numbers which total 540000. I would like to sort
I have a list and would like to sort by date then order by
I have a disturbing case : I would like to sort a list of
i created a stored procedure recently, and i would like to sort the list

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.