Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-02-2013, 12:38 AM   #1
OldLincoln
Zealot
OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.
 
OldLincoln's Avatar
 
Posts: 103
Karma: 1961918
Join Date: Feb 2012
Device: FBReader
Search/Replace ID?

I understand the reasons for not automatically changing the mobi-asin to amazon, but is it possible to do a search ("mobi-asin") and replace ("amazon") as the ID of selected books, without changing the actual number?

I must do this before I download metadata for selected books or it mostly returns the wrong book. Yes I just tested it on ver 1.1.0 selecting the first 20 books and the very first one was wrong. Since I began manually replacing the ID (mobi-asin) with ("amazon") it never once had an error.

I see where I can search and replace several field entries but not ID identifiers themselves. If this is not possible please just say so. I love Calibre and am in it every day as reading is my "retirement job". When asked what I do, I tell people I'm a "bookkeeper".
OldLincoln is offline   Reply With Quote
Old 09-02-2013, 12:57 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,299
Karma: 27111240
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Sure you can, choose the

search field identifiers,
identifier type: mobi-asin
the search for expression (.*)
the replace expression \1
destination field: identifiers
destination identifier type: amazon

This will copy all mobi-asin ids to amazon ids in books that have mobi-asin ids.
kovidgoyal is offline   Reply With Quote
Advert
Old 09-04-2013, 02:29 PM   #3
OldLincoln
Zealot
OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.
 
OldLincoln's Avatar
 
Posts: 103
Karma: 1961918
Join Date: Feb 2012
Device: FBReader
I've been giving this a solid try and am close but hit a bump. I'm selecting books, go to Edit Metadata in Bulk. I select the following:

Search Field: identifiers
Identifier Type: mobi-asin
Search For: .*
Replace With: .*
Identifier Type: amazon

NOTE: These are all the fields I see. I don't know where to apply the "\1" you show for replace expression as there isn't a field.

My entries result in the the following:
On books that have a mobi-asin, it adds the amazon ID with the same number as the mobi-asin and leaves the mobi-asin in place.

On books with an amazon ID but not a mobi-asin ID it deletes the amazon ID.

I can use this by checking each book for the mobi-asin id or just take a chance since they all seem to have it. But if feels incomplete and I wonder if that "\1" is crucial. Am I entering this in the right place? I do want it to only modify the books selected, not the entire library.
OldLincoln is offline   Reply With Quote
Old 09-04-2013, 03:03 PM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,401
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by OldLincoln View Post
I've been giving this a solid try and am close but hit a bump. I'm selecting books, go to Edit Metadata in Bulk. I select the following:

Search Field: identifiers
Identifier Type: mobi-asin
Search For: .*
Replace With: .*
Identifier Type: amazon

NOTE: These are all the fields I see. I don't know where to apply the "\1" you show for replace expression as there isn't a field.

My entries result in the the following:
On books that have a mobi-asin, it adds the amazon ID with the same number as the mobi-asin and leaves the mobi-asin in place.

On books with an amazon ID but not a mobi-asin ID it deletes the amazon ID.

I can use this by checking each book for the mobi-asin id or just take a chance since they all seem to have it. But if feels incomplete and I wonder if that "\1" is crucial. Am I entering this in the right place? I do want it to only modify the books selected, not the entire library.
Use
Code:
Search Field: identifiers
Identifier Type: mobi-asin
Search For: (.*)
Replace With: \1
Identifier Type: amazon
Note the parentheses in the search for expression. They are important.

And yes, this S/R will create a new identifier "amazon". It won't delete the identifier "mobi-asin". You need to do that in a second-pass S/R, changing the destination identifier type to mobi-asin and removing the \1 from replace with.
chaley is offline   Reply With Quote
Old 09-04-2013, 03:50 PM   #5
OldLincoln
Zealot
OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.OldLincoln ought to be getting tired of karma fortunes by now.
 
OldLincoln's Avatar
 
Posts: 103
Karma: 1961918
Join Date: Feb 2012
Device: FBReader
Code:
Search Field: identifiers
Identifier Type: mobi-asin
Search For: (.*)
Replace With: \1
Identifier Type: amazon
I did the above and it works as stated - thanks.

The delete as follows did not work
Code:
Search Field: identifiers
Identifier Type: mobi-asin
Search For: (.*)
Replace With:
Identifier Type: mobi-asin
It didn't appear to do anything, but unless it's a problem I think I can just leave the mobi-asin as an additional ID.

Thanks for all your help. This will save me a lot of time.
OldLincoln is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Search and Replace SOThunder Conversion 2 04-29-2012 08:29 AM
Search and replace TdeV Sigil 1 10-30-2011 04:45 PM
search and replace - drops blanks in replace ? cybmole Conversion 10 03-13-2011 03:07 AM
Search and replace in 0.2.0 paulpeer Sigil 7 03-13-2010 11:59 AM
Why no search and replace? charleski Sigil 10 11-24-2009 04:13 PM


All times are GMT -4. The time now is 09:30 PM.


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