I think this should be easy, but I have forgotten the exact syntax:
- I have a group of notes whose $Name field is book titles.
- About half the titles are entered with an opening “The” – “The Age of Reform,” etc – and about half have no initial “The,” as in “Pilgrim’s Progress.”
- I would like to sort all the titles alphabetically as if the initial THE were not there.
- This would be easier if they were entered in the form of “Age of Reform, The” – but they’re not.
- I don’t see a built-in function that does this kind of “The-agnostic” sort, so I am wondering how to structure a rule or query.
I think I need a new field called something like $IndexingTitle, and I need some transformation rule that will:
- Search for notes whose $Name begins “The”;
- For those notes, set $IndexingTitle to the equivalent of $Name-“The” or “$Name minus its first four characters”; [I’m aware that these quotes are being auto-transformed into curly quotes – let’s ignore that for now.]
- For other notes, set $IndexingTitle=$Name.
I don’t know the right way to set the query – for notes whose names begin with a certain string, nor the way to set the rule or action, to remove that four-character initial string. Would welcome guidance, and asking “in public” for shared-education purposes.