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 09-09-2014, 12:25 PM   #556
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,770
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Try
Code:
program: list_equals(approximate_formats(), ',', 'pdf', ',', 'Yes', 'No')
chaley is offline   Reply With Quote
Old 09-09-2014, 12:31 PM   #557
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)
You should be able to search for all books with only one format, PDF, using:

Code:
format:#=1 and format:"=PDF"

Last edited by eschwartz; 09-09-2014 at 05:29 PM.
eschwartz is offline   Reply With Quote
Old 09-09-2014, 02:30 PM   #558
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,912
Karma: 55267620
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 EnergyLens View Post
I thought this would be easy, but I am totally lost.

I know how to do a search for only PDF by excluding other formats, but I don't know how to use the template language to do the same...

Can someone give me a quick pointer?
search:
Code:
formats:#=1 and formats:PDF
Show only count of formats =1
and
show formats = PDF
theducks is offline   Reply With Quote
Old 09-09-2014, 02:46 PM   #559
EnergyLens
Hack
EnergyLens began at the beginning.
 
Posts: 34
Karma: 12
Join Date: Dec 2009
Device: Kobo Aura HD, Kindle Paperwhite
Quote:
Originally Posted by chaley View Post
Try
Code:
program: list_equals(approximate_formats(), ',', 'pdf', ',', 'Yes', 'No')
That's great! I was trying to use list_equals but was unaware of the program command. THANKS!
EnergyLens is offline   Reply With Quote
Old 09-09-2014, 05:29 PM   #560
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)
Quote:
Originally Posted by theducks View Post
search:
Code:
formats:#=1 and formats:PDF
Show only count of formats =1
and
show formats = PDF
Yes, it does.

Quote:
Originally Posted by eschwartz View Post
You should be able to search for all books with only one format, PDF, using:

Code:
format:#=1 and format:"=PDF"
eschwartz is offline   Reply With Quote
Old 09-09-2014, 06:21 PM   #561
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,912
Karma: 55267620
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 eschwartz View Post
Yes, it does.
You forgot the S in formats
theducks is offline   Reply With Quote
Old 09-09-2014, 08:25 PM   #562
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)
Quote:
Originally Posted by theducks View Post
You forgot the S in formats
I usually use the GUI for all this.

Either the online manual needs a correction or either one works. http://manual.calibre-ebook.com/gui....arch-interface
eschwartz is offline   Reply With Quote
Old 09-18-2014, 03:49 AM   #563
crissman
Connoisseur
crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.
 
Posts: 77
Karma: 3090
Join Date: Apr 2013
Location: California
Device: Kobo Aura One, Kobo Aura H20,Kindle PW1
Maximizing "shorten" field when dealing with a single word series title?

Quick question, just a quirk of mine, but annoying just the same..

Code:
{#stripped_series:shorten(4,-,4)}{series_index:0>3s| [|] }{title}
(I also have the corresponding columns)

A series that has multiple words like A Song of Ice and Fire gets shortened down to its initials which is perfect, what is bothersome to me is when a series like "The Coincidence" gets stripped into Coincidence which again is okay, but its shortened form it becomes Coin-ence.

What would I need to change in order for it to show instead either "Coincidence" or "The Coincidence" for series that are either a single word or preceded by "The" or "A" etc. yet still retain the "initial" values for a longer series name such as A Song of Ice and Fire (ASoIaF) or Lord of the Rings (LotR)

[EDIT] Kinda figured it out, I changed the value: shorten(4,-,4) to shorten(12,-,6), but now I am wondering what is the allowable amount of characters on a title field on a Kindle PW1 and a Kobo Aura HD?

Thanks yet again in advance for any help with this.

Last edited by crissman; 09-18-2014 at 04:26 AM. Reason: Kinda Figured it out..
crissman is offline   Reply With Quote
Old 09-18-2014, 10:20 AM   #564
DMee
Zealot
DMee began at the beginning.
 
Posts: 116
Karma: 10
Join Date: Jun 2011
Location: Stockport, UK
Device: ipad, iphone, kindle
On a similar vein, rather than just the initials - is it possible to have the first x characters of each word?

Lor-of-the-Rin [01] etc ??
DMee is offline   Reply With Quote
Old 09-18-2014, 05:11 PM   #565
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)
Quote:
Originally Posted by crissman View Post
Quick question, just a quirk of mine, but annoying just the same..

Code:
{#stripped_series:shorten(4,-,4)}{series_index:0>3s| [|] }{title}
(I also have the corresponding columns)

A series that has multiple words like A Song of Ice and Fire gets shortened down to its initials which is perfect, what is bothersome to me is when a series like "The Coincidence" gets stripped into Coincidence which again is okay, but its shortened form it becomes Coin-ence.

What would I need to change in order for it to show instead either "Coincidence" or "The Coincidence" for series that are either a single word or preceded by "The" or "A" etc. yet still retain the "initial" values for a longer series name such as A Song of Ice and Fire (ASoIaF) or Lord of the Rings (LotR)

[EDIT] Kinda figured it out, I changed the value: shorten(4,-,4) to shorten(12,-,6), but now I am wondering what is the allowable amount of characters on a title field on a Kindle PW1 and a Kobo Aura HD?

Thanks yet again in advance for any help with this.
It sounds like you just want {#stripped_series} without using shorten at all.
eschwartz is offline   Reply With Quote
Old 09-18-2014, 05:19 PM   #566
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)
Quote:
Originally Posted by DMee View Post
On a similar vein, rather than just the initials - is it possible to have the first x characters of each word?

Lor-of-the-Rin [01] etc ??
Yes. The part in red is captured to make initials.

Code:
Name: #initials. Template: {#stripped_series:re([\s]?([^\s])[^\s]+(\s|$),\1)}
Change it to
Code:
([^\s]{1,x})
where x is the number of characters you want (including the first time).
So using {1,3} means use that set [^\s] at least once and not more than 3x.
{0,1} is another way of saying "?", or "optional". (Either match only the initial time, or not at all.)

For further information (that is, gory details ) on repeating characters see: http://www.regular-expressions.info/repeat.html#limit
eschwartz is offline   Reply With Quote
Old 09-18-2014, 06:20 PM   #567
crissman
Connoisseur
crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.
 
Posts: 77
Karma: 3090
Join Date: Apr 2013
Location: California
Device: Kobo Aura One, Kobo Aura H20,Kindle PW1
Quote:
Originally Posted by eschwartz View Post
It sounds like you just want {#stripped_series} without using shorten at all.
Yes and No, Even though is a tad annoying to have a series truncated so abruptly, I do see the need for it on single word series that happens to be extra long and so I would still like to use it. Going to test out the lengths available to me on the Kindle to see what I can use.

I do like Dmee idea about having a few more letters on the Intitial Column

Code:
Name: #initials Template: {#stripped_series:re([\s]?([^\s]{1,3})[^\s]+(\s|$),\1)}
However I do get and error: I am sure it is something I am doing, but I can't see it, I copied and pasted from your post.

{#stripped_series:re([\s]?([^\s]{1,3})[^\s]+(\s|$),\1)}
Template Value: EXCEPTION: Value: unknown field 1,3
crissman is offline   Reply With Quote
Old 09-18-2014, 06:55 PM   #568
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)
Quote:
Originally Posted by crissman View Post
Yes and No, Even though is a tad annoying to have a series truncated so abruptly, I do see the need for it on single word series that happens to be extra long and so I would still like to use it. Going to test out the lengths available to me on the Kindle to see what I can use.

I do like Dmee idea about having a few more letters on the Intitial Column

Code:
Name: #initials Template: {#stripped_series:re([\s]?([^\s]{1,3})[^\s]+(\s|$),\1)}
However I do get and error: I am sure it is something I am doing, but I can't see it, I copied and pasted from your post.

{#stripped_series:re([\s]?([^\s]{1,3})[^\s]+(\s|$),\1)}
Template Value: EXCEPTION: Value: unknown field 1,3
Ah, yes.

The brackets are reserved in template mode. That's why I like general program mode. Well, that and you can limit yourself to only using one custom column.

Use the general program mode version found here: http://manual.calibre-ebook.com/temp...l-program-mode
Simply fix the "stripped" variable.

PHP Code:
program:
#       compute the equivalent of the composite fields and store them in local variables
stripped re(field('series'), '^(A|The|An)\s+''');
shortened shorten(stripped4'-' ,4);
initials re(stripped'[\s]?([^\s])[^\s]+(\s|$)''\1');

#       Format the series index. Ends up as empty if there is no series index.
#       Note that leading and trailing spaces will be removed by the formatter,
#       so we cannot add them here. We will do that in the strcat below.
#       Also note that because we are in 'program' mode, we can freely use
#       curly brackets in strings, something we cannot do in template mode.
s_index template('{series_index:0>2.0f}');

#       print(stripped, shortened, initials, s_index);

#       Now concatenate all the bits together. The switch picks between
#       initials and shortened, depending on whether there is a space
#       in stripped. We then add the brackets around s_index if it is
#       not empty. Finally, add the title. As this is the last function in
#       the program, its value will be returned.
strcat(
    switch(
        
stripped,
        
'.\s',
        
initials,
        
'.',
        
shortened,
        
field('series')
    ),
    
test(
        
s_index,
        
strcat(' ['s_index'] '),
        
''
    
),
    
field('title')
); 

Last edited by eschwartz; 09-18-2014 at 07:01 PM.
eschwartz is offline   Reply With Quote
Old 09-18-2014, 07:27 PM   #569
crissman
Connoisseur
crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.crissman could sell banana peel slippers to a Deveel.
 
Posts: 77
Karma: 3090
Join Date: Apr 2013
Location: California
Device: Kobo Aura One, Kobo Aura H20,Kindle PW1
Sounds like a good plan, will look into this.

Here goes another question, I already tried to post a reply but I think it got lost in the clouds

I would like to auto-populate a NON-user defined column "Tags" from my own User Defined Column for Genres in which I use a column type of "text, with a fixed permitted values" and list the various Genres I like to use rather then the mess that comes in from downloading the metadata.

I frequently share books with my Mother and as she uses calibre simple just to hold and send her books to her device. I do know I can have her recreate her library using my metadata.db, and then the information would be sent to her but I was just wondering if there was a way to do it this way?
crissman is offline   Reply With Quote
Old 09-18-2014, 07:45 PM   #570
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)
In Bulk Edit Metadata, you can use regexes to search any one column and replace any one custom column -- does not have to be the same one.

You can also use a template as the search field.
eschwartz is offline   Reply With Quote
Reply

Tags
custom column, tag, tags


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
custom column i need a little help shinken Calibre 3 09-15-2010 03:41 AM
Using Custom Metadata in Save Template EJvdH Calibre 1 07-02-2010 06:06 AM
Accessories Decalgirl Kindle 2 custom skin template srmalloy Amazon Kindle 6 04-09-2010 09:55 PM
Donations for Custom Recipes ddavtian Calibre 5 01-23-2010 04:54 PM
Help understanding custom recipes andersent Calibre 0 12-17-2009 02:37 PM


All times are GMT -4. The time now is 08:39 AM.


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