On this site I found a great way to sort fields while ignoring first words like "A" "An" and "The" without having to add at the end preceeded by a comma (,):
($regexp(%artist%,^The ,),^A ,),^An ,)
Is it possible to treat numbers like text and sort alphabetically? (example: "1st" = "First") I believe the statement would call upon a list to convert. If so, I'd like to update the list as needed.
If this is possible, would someone please write the expression I can use. Thanks in advance! I recently discovered this great program and community.
Do you really want to get the numbers - which sort nicely ascending - to vanish somewhere in the alphabet, without the real sorting as
"sixth" comes after "seventh" and "tenth" before "third".
It would also be interesting how far you want to extend that translation: only 1-10 or further?
Or should it be the other way round that "first" gets replaced with "1.", "second" with "2."?
Should this happen only for numbers at the beginning or anywhere in the string?
And what to do with ARTIST names like
777minus111
123 Astronaut
or number-only ARTIST names like
123123
1234!
or with this example:
8767456798324674397524572852252652 ->Jaiden Macintosh and also performs as
I'll change the expression to match yours using | instead of ^.
Yes, I want to sort numbers as text, NOT by number and NOT replacing any spelling in the original name, only in the sort column. For example this order (original spellings):
Fir Song
Fire
1st Song
First Song Next
4 You
For You Next
Four You
Foremost
This will become an almost impossible task.
The general approach would be to add the following example of an expression to the "sort by" field for the column definition: $replace(%title%,10,ten,9,nine,8,eight,7,seven,6,six,5,five,4,four,3,three,2,two,1,one,0,zero)
You would have to start with the biggest number and then go down as e.g. "11" would otherwise be replaced by "oneone" as smaller numbers can be part of larger numbers.
Also, you have to cater for the order numbers. And you would have to take care of number names in other languages.
Even from the list, the interpretation is debatable. Where you have "4 You" this would literally translate to "Four You" but phonetically would be "For You"' for some names. It will be very challenging to create a truly automated solution for these Artistsort changes without going through them manually for accuracy.
That's okay because I only have a dozen or more phrases to translate. It's just easier for me to see listed alphabetically rather than number at top because not all numbered words begin with numbers and I don't want to look twice, 1st at the top of list and 2nd within the list.
Just hoping someone can help with the expression because I don't know how to code. Thanks!
This is one reason why I ask for help because I want to add to the expression a handful of replacements such as "112" replaced to sort as "One Twelve" (I may not know whether it's spelled with a number or letter).