|
|
Thread Tools | Search this Thread |
11-12-2013, 04:43 AM | #1 | |
Enthusiast
Posts: 27
Karma: 10
Join Date: Jun 2013
Device: EZReader Pocket Pro
|
Saving Books: Make folder using only last part of hierarchical tags?
Hey, is it possible to Save Books to Device with a folder system that uses hierarchical tags for one of the folder levels, but only taking the final 'part' of the tag?
Quote:
Why? I'm trying to cut out one of my custom columns that I need for in-calibre organization, but is unnecessary on my reader. All the contents of Column B are essentially subheadings of the contents of Column A. Is there any way to tell calibre to do this? I know you can tell it to use shortened versions of authors, etc. Extra: I'm trying to figure out how to change the reader that calibre uses by default when opening a book from within the program. Anyone know how? I did this once, but I can't remember it. Last edited by Feather_Qwill; 11-12-2013 at 04:56 AM. |
|
11-12-2013, 05:12 AM | #2 |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Assuming that the genre column is type "text" and not "text, like tags", and further assuming that its lookup key is #genre, then the template expression to get the last component is
Code:
{#genre:list_item(-1,.)} |
Advert | |
|
11-12-2013, 05:22 AM | #3 |
Enthusiast
Posts: 27
Karma: 10
Join Date: Jun 2013
Device: EZReader Pocket Pro
|
Is there any way to do this with the "comma-separated text" type of column? Or do I basically need to make a new custom column and somehow copy everything over?
I'd rather keep the comma-separated tag variety if possible, since I often use multiple tags (ie: both Historical and Fantasy for something like Naomi Novik's Temeraire books, or Urban Fantasy and Mystery for Jim Butcher's Dresden Files books. |
11-12-2013, 05:25 AM | #4 | |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
11-12-2013, 05:55 AM | #5 |
Enthusiast
Posts: 27
Karma: 10
Join Date: Jun 2013
Device: EZReader Pocket Pro
|
Thank you!
So would I use {#genre:list_item(1,-1,.)} ? or something like {#genre:list_item(-1,.),first_non_empty(value)} to select the last part of the first tag? I'm sorry, I just have a bit of a hard time understanding all the technical language in the manual. |
Advert | |
|
11-12-2013, 06:20 AM | #6 |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Selecting the first genre from a list of them is a bit complicated. We must first be sure that we know what "first" means. You probably mean it to be the first displayed, so we need to sort the list (list_sort) because inside calibre its sort order isn't defined. We then must extract the first tag from the sorted list (sublist), and finally extract the last item from that first tag (list_item).
The following template in template program mode should work Code:
{#genre:'list_item(sublist(list_sort($, 0, ','), 0, 1, ','), -1, '.')'} |
11-13-2013, 03:08 AM | #7 |
Enthusiast
Posts: 27
Karma: 10
Join Date: Jun 2013
Device: EZReader Pocket Pro
|
Thank you for all your help.
|
Tags |
directory, hierarchical, tags |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Saving books WITHOUT the folder structure | janowskima | Library Management | 3 | 10-29-2013 11:20 PM |
Calibre speed and hierarchical tags | Noughty | Library Management | 10 | 01-24-2013 01:30 PM |
Hierarchical tags and their format on book details | Noughty | Library Management | 12 | 02-19-2012 07:47 AM |
[Old Thread] Join books with same tags into one folder. | ElLoco | Calibre | 8 | 03-29-2011 03:41 PM |
Folder structure when adding vs. saving books | drp | Calibre | 2 | 07-05-2009 01:19 PM |