Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 10-12-2012, 03:57 AM   #1
anvarit
Member
anvarit began at the beginning.
 
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
anvarit is offline   Reply With Quote
Old 10-12-2012, 04:08 AM   #2
anvarit
Member
anvarit began at the beginning.
 
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
anvarit is offline   Reply With Quote
Advert
Old 10-12-2012, 04:10 AM   #3
mbovenka
Wizard
mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.
 
Posts: 2,013
Karma: 13471689
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
Quote:
Originally Posted by anvarit View Post
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?
Try something like (in Bulk Edit -> Search & Replace):

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.
mbovenka is offline   Reply With Quote
Old 10-12-2012, 04:40 AM   #4
anvarit
Member
anvarit began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Sep 2010
Device: Kindle DX (dxg)
Quote:
Originally Posted by mbovenka View Post
Try something like (in Bulk Edit -> Search & Replace):

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.
That worked great, if you have the time could you explain the expression ".* -"?
anvarit is offline   Reply With Quote
Old 10-12-2012, 05:09 AM   #5
mbovenka
Wizard
mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.
 
Posts: 2,013
Karma: 13471689
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
Quote:
Originally Posted by anvarit View Post
That worked great, if you have the time could you explain the expression ".* -"?
. : any character
* : 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
mbovenka is offline   Reply With Quote
Advert
Old 10-12-2012, 05:39 AM   #6
anvarit
Member
anvarit began at the beginning.
 
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.
anvarit is offline   Reply With Quote
Old 10-12-2012, 05:50 AM   #7
mbovenka
Wizard
mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.
 
Posts: 2,013
Karma: 13471689
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
Quote:
Originally Posted by anvarit View Post
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?
Yeah, that would work (because the dot is in \W). Something like ".*\." would work as well, by specifically escaping the dot and not treating it special.

With regexes, there are often more ways than one to get the result you want.
mbovenka is offline   Reply With Quote
Old 10-12-2012, 06:10 AM   #8
anvarit
Member
anvarit began at the beginning.
 
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?
anvarit is offline   Reply With Quote
Old 10-12-2012, 06:22 AM   #9
mbovenka
Wizard
mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.
 
Posts: 2,013
Karma: 13471689
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Sage
Quote:
Originally Posted by anvarit View Post
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?
As in 'name.001' -> 'name'?

Something like "\.[0-9]*" should work: match the dot and any numbers following it.
mbovenka is offline   Reply With Quote
Old 10-12-2012, 08:20 AM   #10
anvarit
Member
anvarit began at the beginning.
 
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
anvarit is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 05:19 AM.


MobileRead.com is a privately owned, operated and funded community.