View Single Post
Old 10-03-2010, 05:58 AM   #22
kacir
Wizard
kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.
 
kacir's Avatar
 
Posts: 3,463
Karma: 10684861
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
OK.
Here is what I use at this moment
(?P<author>[^-]+)( - \[?(?P<series>[^-]+)(\[| )+(?P<series_index>[0-9]+)\]?)? - (?P<title>.+)

It will process
Bitten.rtf
Armstrong, Kelley - Bitten.rtf
Armstrong, Kelley - Otherworld 1 - Bitten.rtf
Armstrong, Kelley - [Otherworld 1] - Bitten.rtf
Armstrong, Kelley - Otherworld [1] - Kelley Armstrong - Bitten.rtf
Kelley Armstrong - Otherworld 1 - Bitten.rtf
Kelley Armstrong - [Otherworld 1] - Bitten.rtf
Kelley Armstrong - Otherworld [1] - Bitten.rtf

At the end of the day you
- Select books you have added
- Right click, select Bulk Edit Metadata
- go to Search and Replace
- select Search mode Regular Expressions
- Search for ([^,]*), (.*)
- Replace expression \2 \1
- and, of course select Search Field and Destination Field "authors"

Not a single step, but better than adding thousands well organized books from an old hoard one by one ;-)

EDIT:
Do you want me to explain that monstrous (and almost unreadable by *me* - the author) Regular Expression in detail?

Last edited by kacir; 10-03-2010 at 06:01 AM.
kacir is offline   Reply With Quote