|
|||||||
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Enthusiast
![]() Posts: 42
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". |
|
|
|
|
|
#2 |
|
Enthusiast
![]() Posts: 42
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? |
|
|
|
| Advert | |
|
|
|
|
#3 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,621
Karma: 28549046
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Code:
Search for: mobi-asin:([a-z0-9]{10})
|
|
|
|
|
|
#4 |
|
Enthusiast
![]() Posts: 42
Karma: 10
Join Date: Dec 2013
Device: Kindle/Android
|
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. |
|
|
|
|
|
#5 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,621
Karma: 28549046
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})$
Last edited by kovidgoyal; 02-17-2017 at 12:22 PM. |
|
|
|
| Advert | |
|
|
|
|
#6 | |
|
Enthusiast
![]() Posts: 42
Karma: 10
Join Date: Dec 2013
Device: Kindle/Android
|
Quote:
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? |
|
|
|
|
|
|
#7 |
|
just an egg
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,848
Karma: 8006346
Join Date: Mar 2015
Device: Kindle, iOS
|
nevermind
Last edited by odamizu; 11-22-2017 at 11:15 PM. |
|
|
|
|
|
#8 |
|
Member
![]() Posts: 11
Karma: 10
Join Date: Mar 2019
Device: Samsung Galaxy Tab 2
|
I know this is a very old post, Kovid, but I can't find the post that gave an example of how to do what I'm trying to do..
Having a similar issue where I have many old books from various sources over the years, I have found many of my books to have improper MOBI-ASIN strings in the identifier field. What I am trying to do is to find a way to search for and then bring up a list of JUST those books where the length of the string is greater than they 10 character length. I remember there was another post that explained how to do it, but I have been searching for it for the past 2 hours to no avail. If you see this post, could you please reply with how to accomplish this so I can save it for future reference. Thank you |
|
|
|
|
|
#9 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,621
Karma: 28549046
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I dont think you can search to bring them up but you can use search and replace to remove them directly, change {10} in the expression I posted above to {11,} to replace ones with 11 characters or greater.
Last edited by kovidgoyal; 11-06-2025 at 11:51 PM. |
|
|
|
|
|
#10 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,621
Karma: 28549046
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Actually you can search and bring up a list as well
Code:
identifiers:"=mobi-asin:~^[a-zA-Z0-9]{11,}$"
|
|
|
|
|
|
#11 |
|
Member
![]() Posts: 11
Karma: 10
Join Date: Mar 2019
Device: Samsung Galaxy Tab 2
|
Thank you so much!
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| force mobi-asin identifier download from amazon source? | blaenk | Calibre | 10 | 06-20-2016 03:15 AM |
| Search & Replace on only mobi half of a mobi/k8 combined file | EliW | Conversion | 0 | 05-04-2013 12:50 AM |
| Difference between mobi-asin and amazon? | MelBr | Library Management | 1 | 03-30-2013 01:05 AM |
| how to get mobi-asin:B0xx into book.mobi - exth 113 | gggggg | Conversion | 4 | 03-25-2013 10:14 PM |
| What happens when MOBI matches actual ASIN in Amazon's database? | Zero9 | Conversion | 0 | 05-29-2011 11:20 AM |