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 08-15-2012, 08:35 AM   #1
Rob557
Zealot
Rob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-books
 
Posts: 108
Karma: 810
Join Date: Jul 2012
Device: Kobo
Question Sort library by length of title (or author, etc) ?

Some titles are ridiculously long. Does anyone have an approach, such as using a custom column, to sort the library based on the length of the title (or length of authors, etc)? I would then manually edit the largest ones.

One partial tool seems to be the Quality Check plugin (check metadata / check titles with series), which seems to list a lot of the problem titles (I think because it includes a check for ":" which is often used in extended titles ... I don't know how to do a direct check for ":" in the title because something like search:: doesn't work in the search field).

An alternative is to generate an excel-type catalog of the library and then sort within excel using len(...), but I was wondering if the sort can be done within Calibre to make it easier to group the items to be edited?
Rob557 is offline   Reply With Quote
Old 08-15-2012, 09:34 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,802
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Rob557 View Post
Some titles are ridiculously long. Does anyone have an approach, such as using a custom column, to sort the library based on the length of the title (or length of authors, etc)? I would then manually edit the largest ones.

One partial tool seems to be the Quality Check plugin (check metadata / check titles with series), which seems to list a lot of the problem titles (I think because it includes a check for ":" which is often used in extended titles ... I don't know how to do a direct check for ":" in the title because something like search:: doesn't work in the search field).

An alternative is to generate an excel-type catalog of the library and then sort within excel using len(...), but I was wondering if the sort can be done within Calibre to make it easier to group the items to be edited?
You might be able to use the Search and Replace inside the Bulk metadata editor
Select a small group of books first
You should be able to find anything your REGEX foo can code
You can even set a value in a destination (custom) column
(like string length if you can figure out if using chaleys advanced template expressions will work here)
theducks is offline   Reply With Quote
Advert
Old 08-15-2012, 10:57 AM   #3
Rob557
Zealot
Rob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-books
 
Posts: 108
Karma: 810
Join Date: Jul 2012
Device: Kobo
Quote:
Originally Posted by theducks View Post
... You can even set a value in a destination (custom) column (like string length if you can figure out if using chaleys advanced template expressions will work here)
I tried setting up a custom column called title_length, where the custom column type was "column built from other columns", but the template I tried to use was {strlen(title)}.

But it only produced error messages in the column that was created.

I obtained the strlen(a) function from http://manual.calibre-ebook.com/template_lang.html .

Any thoughts on how the template should be tweaked, if that sort of approach is okay?
Rob557 is offline   Reply With Quote
Old 08-15-2012, 12:27 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: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Try "program: strlen(field('title'))" no quotes. I am using my phone so it might not be right.
chaley is offline   Reply With Quote
Old 08-15-2012, 12:54 PM   #5
Rob557
Zealot
Rob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-books
 
Posts: 108
Karma: 810
Join Date: Jul 2012
Device: Kobo
Quote:
Originally Posted by chaley View Post
Try "program: strlen(field('title'))" no quotes. I am using my phone so it might not be right.
Interestingly, that will produce a correct count in the custom column for the number of characters in the title of the first book in the library, but displays an error for all the other books. I then tried enclosing in {} but that didn't work at all.
Rob557 is offline   Reply With Quote
Advert
Old 08-15-2012, 01:01 PM   #6
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,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
What is the error?
chaley is offline   Reply With Quote
Old 08-15-2012, 01:14 PM   #7
Rob557
Zealot
Rob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-books
 
Posts: 108
Karma: 810
Join Date: Jul 2012
Device: Kobo
Quote:
Originally Posted by chaley View Post
What is the error?
The error message displayed in each row of the custom column is "TEMPLATE ERROR expecting string or buffer".

The following is what I have as the template in the definition of the custom column, which has a column type of "column built from other columns":
program: strlen(field('title'))
Rob557 is offline   Reply With Quote
Old 08-15-2012, 01:37 PM   #8
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,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Use "program:format_number(strlen(field('title')), '{0:d}')"
chaley is offline   Reply With Quote
Old 08-15-2012, 01:50 PM   #9
Rob557
Zealot
Rob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-books
 
Posts: 108
Karma: 810
Join Date: Jul 2012
Device: Kobo
Perfect ...

Quote:
Originally Posted by chaley View Post
Use "program:format_number(strlen(field('title')), '{0:d}')"
The column now shows the length of the title name for each of the books. Thanks chaley ... that worked perfectly !

:Aug 18 INSERT: Later in this thread an issue arises regarding the sorting of the new custom column. I should have noted in more detail that in setting up the custom column (by right-clicking on the existing row of column descriptors and selecting "add your own columns", then clicking on the "+" icon (or the "i" icon after the column is set up)), after inputting a name of your choice and choosing the column type "column built from other columns", and inputting the template description that chaley provided
"program:format_number(strlen(field('title')), '{0:d}')"
it is important (as chaley identifies later in this thread) to also select the accompanying option to sort/search column by "number".

Last edited by Rob557; 08-18-2012 at 09:15 PM. Reason: belatedly adding INSERT to provide more detail in advance of the sort issue that comes up later in this thread
Rob557 is offline   Reply With Quote
Old 08-15-2012, 09:17 PM   #10
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,802
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Rob557 View Post
The column now shows the length of the title name for each of the books. Thanks chaley ... that worked perfectly !
See, I told you his template functions could have possibilities
theducks is offline   Reply With Quote
Old 08-16-2012, 06:34 AM   #11
Rob557
Zealot
Rob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-booksRob557 has learned how to read e-books
 
Posts: 108
Karma: 810
Join Date: Jul 2012
Device: Kobo
Quote:
Originally Posted by theducks View Post
See, I told you his template functions could have possibilities
Being able to set up and sort on those columns (I used the same approach for the length of the authors field) has made it much more convenient to shorten the names on excessively long titles and authors.

The shortened fields help to flush out more duplicate files by helping to first remove extraneous add-ons to those two fields (particularly when merging libraries), and then using the Find Duplicates plug-in.

The names of files when using "save to disk" are also shortened to a more practical length.

Thanks again to chaley, and thank you theducks ... you were right regarding chaley's toolkit and the basic approach to take.
Rob557 is offline   Reply With Quote
Old 08-17-2012, 10:36 PM   #12
copyrite
Wizard
copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.
 
copyrite's Avatar
 
Posts: 1,814
Karma: 4985051
Join Date: Sep 2010
Location: Maryland
Device: ...lots! ;) mostly reading on a Kindle Voyage
This works great!

Once this custom column is set up, how does one search for books with titles, say, greater than 30 characters?
copyrite is offline   Reply With Quote
Old 08-17-2012, 11:51 PM   #13
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,802
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by copyrite View Post
This works great!

Once this custom column is set up, how does one search for books with titles, say, greater than 30 characters?
You could click the colum header and sort on that column
or
#columnname:>=30
see the fine manual section here http://manual.calibre-ebook.com/gui.html#id21
theducks is offline   Reply With Quote
Old 08-18-2012, 09:25 AM   #14
copyrite
Wizard
copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.copyrite ought to be getting tired of karma fortunes by now.
 
copyrite's Avatar
 
Posts: 1,814
Karma: 4985051
Join Date: Sep 2010
Location: Maryland
Device: ...lots! ;) mostly reading on a Kindle Voyage
Sorting by the header sort of works, but it gives me wonky results. Here's a mere sampling of my library to show you what I mean:

Spoiler:


That was the exact phrase I attempted to search for, yes, from the page you indicated, but it didn't work, maybe because the RegEx needs to allow for two numeric place holder values?
copyrite is offline   Reply With Quote
Old 08-18-2012, 10:35 AM   #15
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,802
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by copyrite View Post
Sorting by the header sort of works, but it gives me wonky results. Here's a mere sampling of my library to show you what I mean:

Spoiler:


That was the exact phrase I attempted to search for, yes, from the page you indicated, but it didn't work, maybe because the RegEx needs to allow for two numeric place holder values?
Good you included a screen shot
That screen shows 'Digits' (text), not Numbers, which is why the Search term (for a numeric field) does not work.

The column needs to be Floating Point for that to work
or you need to pad enough leading 0's (blanks are just too hard to see ) to match the highest digit count
theducks is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-650 [calibre] How do I set it up so I can sort by author - Series - Title?? BelgarionNL Sony Reader 49 06-22-2012 10:04 PM
Caibre - Fails to sort by Author, Title, etc LesWilk Devices 1 03-17-2012 06:41 AM
Sort by author then title richardwarriner Library Management 3 11-16-2011 01:00 PM
Author then title sort Gary Young Calibre 4 08-30-2010 10:03 PM
Sort by author AND title bookends Calibre 2 05-09-2010 01:55 PM


All times are GMT -4. The time now is 06:10 PM.


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