Ik gebruik deze expressies voor mijn collectie:
Normale boeken:
(?P<author>[^_-]+) -?\s*(?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)\s*-\s*(?P<title>[^_].+) ?
Series:
(?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)\s*-\s*(?P<title>[^_].+)\s*-\s*(?P<author>[^_-]+) ?
Probleemgevallen:
^((?P<author>([^\_0-9#]+)(?=\s*-\s*)(?!\s*-\s*[0-9.]+)|\b))(\s*-\s*)?((?P<series>[^0-9\-#]+)(\s*-\s*)?(?P<series_index>[0-9.]+)\s*-\s*)?(?P<title>[^\_#]+)
En ik gebruik ook save to disk expressies zoals deze die een serie erin zet als die bestaat:
{authors} - {series:|[| }{series_index:0>2s||] - }{title}
Deze ga ik nu gebruiken omd die ook met vreemde tekens overweg kan zoals streepjes:
(?P<author>[^_-]+) -?\s*(?P<series>[^_0-9]*)(?P<series_index>[0-9]*)\s*- \s*(?P<title>[^_#]+) ?
Commentaren eruit:
(?P<author>[^_-]+-?[A-Za-z]+[^_-]+-?[A-Za-z]+[^_-]+) -?\s*(?P<series>[^_0-9]*)(?P<series_index>[0-9]*)-?[0-9]?[0-9]?[0-9]?\s*- \s*(?P<title>[^_#]+) ?
Commentaren erin:
(?P<author>[^_-]+-?[A-Za-z]+[^_-]+-?[A-Za-z]+[^_-]+) -?\s*(?P<series>[^_0-9]*)(?P<series_index>[0-9]*)-?[0-9]?[0-9]?[0-9]?\s*- \s*(?P<title>[^_]+) ?
Maar kort gezegd in jouw geval is dit denk ik het best:
code:
1
| (.+- )?(?P<series>(?:(?![0-9-]*\s-\s).)*)\s?(?P<series_index>[0-9]*)\s?-?[0-9]*\s*-\s(?P<title>[^#]+)#\s(?P<author>.+) |
En zo moet de titel eruit zien:
(Series) - (Series)(Series_index) - (Titel) # (Auteur)
En serie is dan optioneel
Dan werkt in iedergeval met deze titeltests:
The 4400 - The 4400 03 - Welcome to Promise City # Greg Cox.epub
Able Team - Able Team 01 - Tower of Terror # L. R. Payne.zip
Halo - Halo 01 - The Fall of Reach # Eric Nylund.epub
Halo - Glasslands # Karen Traviss.epub
24 Declassified - 24 Declassified 01 - Operation Hell Gate # Marc Cerasini.epub
Maar eigenlijk ga je nu andersom werken, het is fijner om vanuit de meta data van calibre de bestandsnamen aan te passen.
Handleiding:
quote:
This isn't as complicated as it looks!
So I was switching a bunch of authors from last name, first name to first name last name using regular expressions in Search and Replace.
We can do the same thing here.
(Note: Test this on a single book first just in case you mess it up)
Here's the full process:
1 - Create a new column (if you already know how to do this, skip)
Right click on a column header at the top of your book list
Click on "Add your own columns"
Click the green + sign at the right edge of the "Add your own columns" window
Give it a Lookup name and Column Heading - whatever you want (Lookup name is the internal reference name, Column Heading is what's displayed in Calibre)
Column type should be "Text, column shown in the tag browser"
Click ok until Calibre tell you it needs to reboot. Let it reboot.
2 - Move additional info/comments to your new custom column
Highlight all books you want to move the comment to your new column - Use the filter to filer for titles with #!
right-click and select Edit metadata -> Edit metatdata in bulk
Go to the "Search and Replace" tab
For "Search mode" select Regular Expression (Default is "Character match")
For Search field select "Title"
For Destiation field select the "Lookup name" you created in step 1
In "Search for" put: (.*) # (.*)
In "Replace with" put: \2
Important: Doublecheck that the test at the bottom is correct!!!
Click Ok
All the additional info/comments should now be in your custom column. It's also still in all your titles. If you want to remove from the titles then:
3 - Remove additional info/comments from titles
Highlight all books you want to move the comment to your new column - Use the filter to filer for titles with #!
right-click and select Edit metadata -> Edit metatdata in bulk
Go to the "Search and Replace" tab
For "Search mode" select Regular Expression (Default is "Character match")
For Search field select "Title"
For Destiation field select "Title"
In "Search for" put: (.*) # (.*)
In "Replace with" put: \1
Important: Doublecheck that the test at the bottom is correct!!!
Click Ok
Note: There's an option to save the search and replace rules. I've saved these two as "Comments 1" and "Comments 2" so it's really easy to apply the the two steps as needed.
Note: If you do the move function on a Title that doesn't have comments then you'll copy your title oer to your custom comments. If you do the delete function on a Title that has no comments there's no effect. So you want to avoid this but it's not a crisis.
En met plugins kan calibre deze metafata redelijk automatisch binnenhalen uit gewenste bronnen. Handmatig titels aanpassen als je calibre hebt is als html codes inkloppen in notepad terwijl je dreamweaver hebt (of welke html editor dan ook)
Dikkiedikdik wijzigde deze reactie 12-04-2013 07:43 (44%)