View Single Post
Old 10-04-2010, 10:16 AM   #27
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Quote:
Originally Posted by dkritso109 View Post
ok first off kacir your awesome,
(?P<author>[^-]+)( - \[?(?P<series>[^-]+)(\[| )+(?P<series_index>[0-9]+)\]?)? - (?P<title>.+)
this works great, this totaly solved my author sort issue.
the only problem is with the series numbers

Foster, Alan Dean - Catechist 02 - Carnivores of Light and Darkness

turns into this

Carnivores of Light and Darkness Foster, Alan Dean
You might want to clarify what part of the above is in what metadata field. If I had to guess, I would say that those are the {title} and {author} fields and thus, from what I can see, the expression works. What is in the series fields?

Quote:
Originally Posted by dkritso109 View Post
please also keep in mind that i am having trouble keeping up with yalls techie kung-fu.
you guys are definately experts at this, while i am a measly little business major.
This has been linked before, but have a look at this post here. It aims to strenghten the regexp-fu even of tie-wearing people.

Quote:
Originally Posted by dkritso109 View Post
also one more thing:
i know nothing about the search and replace function, all of my 4000 + books are already in the Alan Dean Foster format how do i change them all to Foster, Alan Dean. what exactly do i need to do?

so just to recap:
1. my series loses their numbering
2. search and replace all authors to the author sort format in the author box
Ah, so here's the info I needed above... Do you get any series field? Is the numbering read into the series?
As for the search & replace- stuff here, that's a bit trickier. I suspect something like searching for
Code:
(.*)\s(.*?)
and replacing with
Code:
\2, \1
might do the trick, but I haven't tested it. The difficulty here lies in the fact that you can, as you have demonstrated, have author names with multiple first or last names that are separated by a space, and how do you go about discerning which is which?

Quote:
Originally Posted by dkritso109 View Post
p.s. can anyone lend me a well trained monkey???
My monkey is currently busy hacking a problem I have. I'll tell it you asked.

EDIT: If you were to search & replace for each author individually (or, to be more correct, edit the single firstname, single lastname cases in one go, then edit the double firstname, single lastname, and so on), then the problem would cease to exist, of course. In that case, you could write a custom-tailored regexp to match each author perfectly.

Last edited by Manichean; 10-04-2010 at 10:19 AM.
Manichean is offline   Reply With Quote