Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-05-2013, 12:22 AM   #1
capnm
Groupie
capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'
 
Posts: 156
Karma: 10001
Join Date: Feb 2011
Device: sony
How to clean up junk indentifier types?

I've been ignoring all the junk identifier types that have appeared in the identifiers field long enough -- so now I want to get rid of a few hundred of them (mostly ISBNs but other cruft too).

I don't see any easy way to do it though.

I was thinking the most likely would be to use the Bulk Edit Search & Replace function to back up the few I want to keep in spare columns, then just blank the whole identifiers field.

But the only way I see to blank the whole field is one book at a time via Edit Metadata.

Alternatively, removing the identifier types one at a time via Search and Replace is too tedious to contemplate.

Is there another way I've overlooked?


(Am I really the only person with this problem? The cruft comes from mainstream retail epubs, so I find that hard to believe.)
capnm is offline   Reply With Quote
Old 03-05-2013, 01:20 AM   #2
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@capnm - yeah I do the same thing for the same reasons, and yeah they are a pain to remove. It has you cursing the teeny tiny identifiers textbox in the Edit Metadata dialog when you edit them one by one and try to find the right place in the very long line to chop them out of

I tend to use the tag browser, click on them one at a time to bring up the matching set of books for that identifier and then do the edit as you say.

I know there is limited space on that dialog, but they are the sort of data that you want in a list to easily click on an X to delete etc, dunno how it would fit in though without making it a popup.
kiwidude is offline   Reply With Quote
Advert
Old 03-05-2013, 06:32 AM   #3
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: 11,745
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
I submitted code changes to permit arbitrary changes to the identifiers field in bulk search/replace. If the source field is not "identifiers" and the destination field is "identifiers" and the destination identifier is "*", then the result of the search/replace is used to replace the entire identifiers field. To empty the field, use "{template}" as the source field, ".*" as the search for string, "identifiers" as the destination field, and "*" as the destination identifier.

Note that you can construct any set of identifiers you wish in the search/replace operation, making it possible to remove all but some identifiers.

Note also that the string used to generate the resulting identifiers field must be a (possibly null) comma-separated set of colon-separated pairs of strings.
chaley is offline   Reply With Quote
Old 03-05-2013, 08:42 AM   #4
capnm
Groupie
capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'capnm knows the difference between 'who' and 'whom'
 
Posts: 156
Karma: 10001
Join Date: Feb 2011
Device: sony
That's slick, thanks!

So to keep just isbn & goodreads, is this correct?

Search field: {template}
Template: {isbn:|isbn:|, }{identifiers:select(goodreads)|goodreads:|}
Search for: empty
Replace with: empty
Destination field: identifiers
Identifier type:*
Mode: Replace field
Split Result: Unchecked

Do I care about this possibly creating an extraneous trailing comma?
capnm is offline   Reply With Quote
Old 03-05-2013, 09:57 AM   #5
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: 11,745
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by capnm View Post
That's slick, thanks!

So to keep just isbn & goodreads, is this correct?

Search field: {template}
Template: {isbn:|isbn:|, }{identifiers:select(goodreads)|goodreads:|}
Search for: empty
Replace with: empty
Destination field: identifiers
Identifier type:*
Mode: Replace field
Split Result: Unchecked
Yes, except you should leave Split Result checked so that each comma-separated item is treated as a separate identifier. If you uncheck the box then SR tries to treat the string as 1 identifier and will complain that it finds too many colons.
Quote:
Do I care about this possibly creating an extraneous trailing comma?
No, as long as there aren't any non-blank characters following it. Null items are ignored, which means that ",,,,,,,,isbn:12345,,,,,goodreads:81267,,,,,," is also OK.
chaley is offline   Reply With Quote
Advert
Old 05-31-2014, 12:28 PM   #6
ssholloway
Connoisseur
ssholloway has a complete set of Star Wars action figures.ssholloway has a complete set of Star Wars action figures.ssholloway has a complete set of Star Wars action figures.
 
ssholloway's Avatar
 
Posts: 99
Karma: 280
Join Date: Nov 2010
Device: iPhone6, iPadMiniRetina, KindlePW3, KoboGloHD
Many thanks for this. I did discover two minor changes to the formula above that are required for Calibre 1.39. I wanted to keep the ASIN so here's what worked for me:

Search field: {template}
Template: {isbn:|isbn:|, }{identifiers:select(amazon)|amazon:|}
Search for: {template}
Replace with: empty
Destination field: identifiers
Identifier type:*
Mode: Replace field
Split Result: checked
With values separated by:, (i.e., a comma followed by a space)
ssholloway is offline   Reply With Quote
Old 06-02-2014, 05:14 PM   #7
Tatjana
Coffee Girl
Tatjana began at the beginning.
 
Tatjana's Avatar
 
Posts: 16
Karma: 10
Join Date: May 2014
Device: no money for such things
It is possible at this time, using latest Version of Calibre for Windows (1.39) get rid of Identifiers that do not have a identifier prefix?

example: isbn:9780310231202, 0310231205:0310231205

Is it possiible to get rid of all identifiers that do not have a prefix like "isbn:", "amazon:" etc?
Please note the example above has a "junk prefix "0310231205:"

If it is not possible to this on Calibre right now, is there any free sqlite database editor what would allow me to do this?

Thank you very much in advance for any help.
Tatjana is offline   Reply With Quote
Old 06-03-2014, 12:07 AM   #8
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Just edit it normally. There is no way for calibre to know what is a "junk identifier".

Copying it into a text editor or Word should help you see what you are dealing with a little better than scrolling through the tiny edit box.
eschwartz is offline   Reply With Quote
Old 06-03-2014, 12:24 AM   #9
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: 11,745
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Tatjana View Post
It is possible at this time, using latest Version of Calibre for Windows (1.39) get rid of Identifiers that do not have a identifier prefix?

example: isbn:9780310231202, 0310231205:0310231205

Is it possiible to get rid of all identifiers that do not have a prefix like "isbn:", "amazon:" etc?
Please note the example above has a "junk prefix "0310231205:"

If it is not possible to this on Calibre right now, is there any free sqlite database editor what would allow me to do this?

Thank you very much in advance for any help.
Probably the best you can do in calibre, and also I suspect in an SQL db utility, is to keep identifiers if they are in a good identifiers list. However, if you can figure out a regexp (or something) that is guaranteed to match a junk identifier but not a good one then you could do that.

The "good list" technique would use the template approach above to select out the ones you wish to keep.
chaley is offline   Reply With Quote
Old 06-03-2014, 08:23 AM   #10
Tatjana
Coffee Girl
Tatjana began at the beginning.
 
Tatjana's Avatar
 
Posts: 16
Karma: 10
Join Date: May 2014
Device: no money for such things
Quote:
Originally Posted by chaley View Post
Probably the best you can do in calibre, and also I suspect in an SQL db utility, is to keep identifiers if they are in a good identifiers list. However, if you can figure out a regexp (or something) that is guaranteed to match a junk identifier but not a good one then you could do that.

The "good list" technique would use the template approach above to select out the ones you wish to keep.
Excellent post (all your posts on this thread actually.)

You have helped me a whole lot!

a BIG! Thank you!
Tatjana is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessories Don't buy that junk! pewterbot9 enTourage Archive 14 05-29-2011 09:06 AM
Short Fiction Martinez, Brian: A Good Clean, A Harsh Clean. v1. PDF, 13th Dec 2010 BrianMartinez Other Books 0 12-13-2010 09:27 PM
Short Fiction Martinez, Brian: A Good Clean, A Harsh Clean. v1. 13th Dec 2010 BrianMartinez Kindle Books 0 12-13-2010 09:25 PM
Short Fiction Martinez, Brian: A Good Clean, A Harsh Clean. v1. 13th Dec 2010 BrianMartinez ePub Books 0 12-13-2010 09:23 PM
PRS 600 JUNK farmersteve Sony Reader 76 01-17-2010 07:34 AM


All times are GMT -4. The time now is 12:50 PM.


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