10-12-2012, 03:57 AM | #1 |
Member
Posts: 12
Karma: 10
Join Date: Sep 2010
Device: Kindle DX (dxg)
|
Metadata - get number out of Author and in Series
Hi all,
I have a large comic library where the series number is added to the author name. So for eg "De Rode Ridder - 001" (without the "). Now I would like to extract the number out of the Author name and place in the number field of the Series. I've read through the manual (bulk edit) but can't find a way to make it work. Can someone give me hinter or a direction? Or better help me build the string that is needed? All help is appreciated. Regards |
10-12-2012, 04:08 AM | #2 |
Member
Posts: 12
Karma: 10
Join Date: Sep 2010
Device: Kindle DX (dxg)
|
For the moment I have the following:
search mode = regular expression search field: authors search for: [0-9] replace with: destination field: series_index But that didn't do much |
10-12-2012, 04:10 AM | #3 | |
Wizard
Posts: 2,018
Karma: 13471689
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
|
Quote:
Search field: Author Search for: ".* - " (without the quotes) That should result in just the number remaining. Destination field: series_index Note that the Series field must be filled already, or this will not work; you can't have a series_index of a nonexistent Series. |
|
10-12-2012, 04:40 AM | #4 | |
Member
Posts: 12
Karma: 10
Join Date: Sep 2010
Device: Kindle DX (dxg)
|
Quote:
|
|
10-12-2012, 05:09 AM | #5 | |
Wizard
Posts: 2,018
Karma: 13471689
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
|
Quote:
* : repeat as many times as possible unitil the next literal in the regex - : literal space and dash This matches anything up to and including the dash in your author field (and because of the empty 'Replace with' removes it), leaving the number as the result to move into the series_index field. More on Python regular expressions: http://docs.python.org/library/re.html |
|
10-12-2012, 05:39 AM | #6 |
Member
Posts: 12
Karma: 10
Join Date: Sep 2010
Device: Kindle DX (dxg)
|
Ok looked at the python expressions but I can't find a solution to a simple one.
For eg "name.01" and I want have everything behind the dot found it, ".*\W" correct? Last edited by anvarit; 10-12-2012 at 05:41 AM. |
10-12-2012, 05:50 AM | #7 | |
Wizard
Posts: 2,018
Karma: 13471689
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
|
Quote:
With regexes, there are often more ways than one to get the result you want. |
|
10-12-2012, 06:10 AM | #8 |
Member
Posts: 12
Karma: 10
Join Date: Sep 2010
Device: Kindle DX (dxg)
|
yes yes quite logical. And as a last question how do you replace it with an empty field.
I let the destination field empty but what do I have to fill in the replace field to get my number deleted? |
10-12-2012, 06:22 AM | #9 | |
Wizard
Posts: 2,018
Karma: 13471689
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
|
Quote:
Something like "\.[0-9]*" should work: match the dot and any numbers following it. |
|
10-12-2012, 08:20 AM | #10 |
Member
Posts: 12
Karma: 10
Join Date: Sep 2010
Device: Kindle DX (dxg)
|
ah you don't use the replace field to delete something. You just use the same field in destination.
Thanks for the help and have a nice weekend |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Add book number in a series to metadata? | EtrnLwanderer | Sigil | 6 | 03-10-2012 01:48 PM |
Series and Number | Spur52 | Library Management | 5 | 09-16-2011 08:06 PM |
Show series number but not if they aren't in a series? | M4cc45 | Library Management | 10 | 09-03-2011 07:35 PM |
Calibre doesnt remember (Title.Author,Series,Metadata) changes?! | Rafaelo4 | Calibre | 9 | 08-19-2010 07:23 AM |
What is the number in series name? | coredump | Calibre | 1 | 12-21-2009 10:51 AM |