• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X PCB Editor
  3. human ordering sorting challenge for skill

Stats

  • Replies 4
  • Subscribers 161
  • Views 14451
  • Members are here 0
More Content

human ordering sorting challenge for skill

Ejlersen
Ejlersen over 11 years ago

Hi 

I've numerous times come across the issue of sorting strings in a more "human way of thinking fashion" 

I've played around with the different sorting predicates like 'lessp, 'alphaNumCmp, 'axlStrcmpAlpNum but none are really sorting in the way I would need. I had hoped the 'axlStrcmpAlpNum would do what I wanted, but mixed strings are a challenge.

Example (end sorting result that I would like)

"22" 

"111234" 

"111237"

"111a32"

"112323" 

"11235a" 

"11235f"

"abc211"

"xyz211"

I've come across some LISP code for this, but must admit that although I've done a lot of skill programming the code at the link below are a bit "black magic like" for me, it does not translate directly into a skill program

rottcodd.wordpress.com/.../  

So maybe someone could shed som light on how to transform this into something usefull in Skill.

Hint:  www.davekoelle.com/alphanum.html has a number of other language implementations for the same type of sorting, it actually explain and illustrate the problem very nicely.

Thank you very much in advance

Best regards

Ole 

  • Sign in to reply
  • Cancel
Parents
  • Ejlersen
    Ejlersen over 11 years ago

    Hi Olivier

    Thank you for your input on this, I got some code from a long time friend that I've been able to convert into something that can be used.

    I'll try your method to figure out if that works better for me. I'll however need to check for length since any length text must be after numbers, so "aa" will be after any string starting with a number.

    I'm in the same boat as you with numbers to strings, only aware of sprintf. 

    Best regards

    Ole 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Ejlersen
    Ejlersen over 11 years ago

    Hi Olivier

    Thank you for your input on this, I got some code from a long time friend that I've been able to convert into something that can be used.

    I'll try your method to figure out if that works better for me. I'll however need to check for length since any length text must be after numbers, so "aa" will be after any string starting with a number.

    I'm in the same boat as you with numbers to strings, only aware of sprintf. 

    Best regards

    Ole 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information