View Single Post
Old 01-10-2014, 02:59 AM   #465
Gary_M_Mugford
Groupie
Gary_M_Mugford has a complete set of Star Wars action figures.Gary_M_Mugford has a complete set of Star Wars action figures.Gary_M_Mugford has a complete set of Star Wars action figures.
 
Gary_M_Mugford's Avatar
 
Posts: 180
Karma: 299
Join Date: Jul 2010
Location: Brampton ON
Device: Kobo, Kindle3
Quote:
Originally Posted by chaley View Post
Taking this as a challenge ...

What exactly do you want to do? Is #tagsgsm a composite custom column like tags? Are you saying that you want it to contain the word "BioSports" if tags contains the tag Sports and the tag Biography? Our something else?

BTW: (?!xyz) Is not really a group. Instead it tests that whatever text is next does not equal xyz. The interesting thing about this test is that it does not consume the characters negatively matched, so that the test foo(?!bar)\w* will match fooAlphanumeric except if the alphanumeric part starts with bar.
Gawd, does THIS feel familiar. Me pie in the skying and you coming to the battle.

Okay, since YOU ASKED .... I'm faced with this situation. I add a rather large number of books. I then select the newly added ones and change the new books to have an Uncat value in the my #gmtags column. It's not a complex column, just one that allows for my small tag sub-set, Mysteries, Thrillers, SF, NF, Sports, Biographies, Sports Biographies, Bridge, Writing and Young Adult. Then, I ctrl-D and download the metadata from the internet. I then run a series of saved searches that looks for #gmtags=Uncat added to a series of search terms in a bracketed OR clause for the tags field. One that covers, for the most part, each of the gmtags categories. After it finds the uncategorized books that fit, I select all and go into group edit. I check off delete all gmtags and then add that particular gmtag. Click OK and the books all disappear. I then move on to the next saved search. Repeat rinse cycle.

In all, it takes about five minutes. Long for a half-dozen books, really quick for a thousand new uncategorized books.

However, my searches are NOT perfect. I'd say I get somewhere around 80 percent recategorized. I put SOME effort into manually scanning and correcting the rest, but I'm old, lazy and less interested in perfection than I used to be.

ESchwartz has been quite active of late and has started producing code that I find ... interesting. Especially recent threads that have moved towards changing another column through a program rather than a quick one-line regex code (which I got from you, heh heh heh). I need a program (or I think I do) because the end result has to be smarter than what I have currently. The BETTER solution will involve LOTS of nesting when all is said and done. There is the old issue of which one term to use in gmtags when more than one of the 'mother' terms is found. While I have bent on the issue of Sports Biographies, I'm a stubborn old coot on the rest. I have imperiously commanded that Mystery/Thrillers are Thrillers, not Mysteries. At least they are in my small pocket universe.

That's why I was anxiously looking forward to ESchwartz's development of the request he had gotten from ACGauthor. So I could poach. I am not a good man.

That's WHAT I am doing. I would like to shorten the steps down to one really smart super search (that would change the other column), because wrapping it up IN a created column definition might slow things down during normal use of the library I have created in Calibre. I'm sure there are bigger libraries out there. But given the inclusion of academic papers and my own writings and acquired books, mine is sizable.

So there it is, wrapped up in a bunch of peanut shells. What have you got?

Happy New Year, by the way. GM
Gary_M_Mugford is offline   Reply With Quote