Quote:
Originally Posted by Phssthpok
No, I'm using author_sort because it's a sanitised version of authors, consisting of "last, first" (with some special values for people with suffixes like Jr on their published names). So I wanted to avoid using the raw names in favour of the sanitised ones. I would then have to replace "," with another delimiter, replace "&" with ",", then put the commas back in. So I did it this way instead for "simpkicity".
When I tried with a trailing space only it didn't seem to work. Maybe I fubared it when I copy/pasted to the plugboard. I'll try it again.
Anyway, what I'm doing with list_re is splitting the list of multiple authors on "&" (NOT on the commas!), reversing "last, first" to "first last" in each case, and then replacing the "&" separators with (space-surrounded) commas. So for example:
has as its author_sort string the following:
(And come to think of it, I could leave the "(ed.)" bit in the author_sort version without affecting the sort order...)
"Miller Jr., Walter M." is then rearranged back to "Walter M. Miller Jr.", "Haldeman II, Jack C." is rearranged back to "Jack C. Haldeman II (ed.)", and the final result is
which givesnthe desired result.
And for single author books, list_re() returns a list of one item, which is then rearranged.
But you're right, it doesn't seem to work for single-name authors. No comma, no match in the RE. Hmm... 
|
Yes, I understand what you're trying to do. What I don't understand is why you didn't try my suggestion above which is much simpler than all the hoops you are trying to jump through and which, as I mentioned and which you have now observed for yourself, does not meet your goals anyway (it omits some authors). Allow me to repeat myself, which I don't enjoy doing:
did you try my suggestion, and if so, how did it fail to meet your needs? If you're seeking simplicity, my earlier suggestion seems simpler to me and also more robust than what you have come up with here.