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 02-13-2017, 11:46 AM   #1
peekpoke
Member
peekpoke began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Dec 2013
Device: Kindle/Android
Search/Replace MOBI-ASIN into AMAZON ID (I know this is only for USA)

When I import books from my Kindle to Amazon, they have a USA MOBI-ASIN.
I'd like to use the bulk search and replace of Meta-Data to replace all MOBI-ASIN into AMAZON, but only for those with a 10 character ASIN.


If I use the identifier search, I can't figure out how to replace the mobi-asin:, only how to copy it to amazon. If I use search for identifier mobi-asin, and use identifier amazon as the destination, that copies the id to the AMAZON, but does not replace it.

If I use {template} {indentifiers} to for search field/template
Search for: mobi-asin:([a-z0-9]*)
Replace with: amazon:\1

Then it does replace, but matches the non 10 character IDs I don't want to use (won't work).

I tried ([a-z0-9]{10,}), but then it just matches the first 10 characters, and still replaces the mobi-asin with amazon.

I tried this:
mobi-asin:([a-z0-9]{10,})([\s]*)

But I'm unsure if it will work in all cases, and messes up with duplicate AMAZON IDs if I do it for books that already have a AMAZON ID.

I do wish there was an option in MOBI/AZW3 import to transform the MOBI-ASIN into AMAZON if I check a box saying "yes I know this only works if the book was purchased in USA".
peekpoke is offline   Reply With Quote
Advert
Old 02-13-2017, 11:52 AM   #2
peekpoke
Member
peekpoke began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Dec 2013
Device: Kindle/Android
Well, searching for {template} {identifiers} and then using identifiers as the destination with "amazon" as the destination creates a ugly mess of multiple amazon: prefixes.

Is there any way to make changes to {template} {identifiers} and have the destination be the entire identifiers field, not one specific identifier type?
peekpoke is offline   Reply With Quote
Old 02-13-2017, 09:05 PM   #3
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: 31,305
Karma: 8154029
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Code:
Search for: mobi-asin:([a-z0-9]{10})
kovidgoyal is offline   Reply With Quote
Old 02-17-2017, 10:54 AM   #4
peekpoke
Member
peekpoke began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Dec 2013
Device: Kindle/Android
Quote:
Originally Posted by kovidgoyal View Post
Code:
Search for: mobi-asin:([a-z0-9]{10})
If I am using the bulk metadata search and replace, if I put mobi-asin:([a-z0-9]{10}) in as the "Search for:"

Then I have to use {templates} as the search field, and {identifiers} as the Template, which again leads back to what do I use for the Destination field?
If I use identifiers as the Destination field, then I have to specify a Identifier type, which makes a huge mess.

Also when searching {templates} {identifiers} the search string mobi-asin:([a-z0-9]{10}) matches longer IDs like this, it just matches the first 10 characters of the ID.

mobi-asin:d4efab34f4-58f1-5031-87de-656de5b5cf4c

What I'd love is to be able to search/replace the identifiers field just like other fields, or even better a option when importing Kindle books for USA customers that allow us to use the MOBI-ASIN as the AMAZON id.
peekpoke is offline   Reply With Quote
Old 02-17-2017, 11:20 AM   #5
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: 31,305
Karma: 8154029
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Add a $ at the end to match only values of ten characters
Code:
([a-zA-Z0-9]{10})$
And you can choose identifiers for both the search field and the replace field. I dont knwo why you want to go through a template?
Attached Thumbnails
Click image for larger version

Name:	Screenshot_20170217_214910.png
Views:	49
Size:	112.2 KB
ID:	155064  

Last edited by kovidgoyal; 02-17-2017 at 11:22 AM.
kovidgoyal is offline   Reply With Quote
Old 08-06-2017, 05:33 PM   #6
peekpoke
Member
peekpoke began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Dec 2013
Device: Kindle/Android
Quote:
Originally Posted by kovidgoyal View Post
Add a $ at the end to match only values of ten characters
Code:
([a-zA-Z0-9]{10})$
Sadly, the $ doesn't appear to work, it matches both

B071F9WGRQ
and
B071F9WGRQ-ABC

So it matches all the long form MOBI-ASIN identifiers.

I tried a few other variations, but it seems like the regular expressions are acting strangely on indentifiers?
peekpoke 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
force mobi-asin identifier download from amazon source? blaenk Calibre 10 06-20-2016 02:15 AM
Search & Replace on only mobi half of a mobi/k8 combined file EliW Conversion 0 05-03-2013 11:50 PM
Difference between mobi-asin and amazon? MelBr Library Management 1 03-30-2013 12:05 AM
how to get mobi-asin:B0xx into book.mobi - exth 113 gggggg Conversion 4 03-25-2013 09:14 PM
What happens when MOBI matches actual ASIN in Amazon's database? Zero9 Conversion 0 05-29-2011 10:20 AM


All times are GMT -4. The time now is 10:55 AM.


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