01-17-2011, 02:27 PM | #31 |
Fat Guy
Posts: 408
Karma: 24165
Join Date: Jun 2010
Device: Kindle Voyage
|
Ah, yeah that worked well. Thanks once again.
Bummer about the 'nope', though. |
01-17-2011, 03:15 PM | #32 | |
Addict
Posts: 272
Karma: 1050426
Join Date: Feb 2010
Location: California
Device: iPad Mini w/Retina, Kindle 3, Kindle Fire HDX 8.9, & Asus Transformer
|
Quote:
Spoiler:
I know it is something I'm doing wrong your help would be greatly appreciated. |
|
Advert | |
|
01-17-2011, 03:51 PM | #33 |
Junior Member
Posts: 8
Karma: 10
Join Date: Dec 2010
Device: kindle 2
|
me too . iwas able to create a column and a yes /no for read (doesnt seem to work real well getting the ye no box to pop up) . where/how do you ( using calibre .40 )put the comment{comments:kindle_read_percent(95,Yes,No,Uno pened)}? this is where im confused.
|
01-17-2011, 04:50 PM | #34 | |
Grand Sorcerer
Posts: 11,760
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
When doing python functions, spacing and indenting is critical. You must get it exactly right. Copying and pasting code from other than code blocks is almost certain to get it wrong. |
|
01-17-2011, 04:51 PM | #35 |
Grand Sorcerer
Posts: 11,760
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
Advert | |
|
01-19-2011, 04:19 AM | #36 | |
Addict
Posts: 272
Karma: 1050426
Join Date: Feb 2010
Location: California
Device: iPad Mini w/Retina, Kindle 3, Kindle Fire HDX 8.9, & Asus Transformer
|
Quote:
I would like to pick up the date from the annotations and put in a custom column Last Read: 10-12-2010. I have Calibre v. 7.40. How would I do this using a template. Thanks. |
|
01-19-2011, 04:58 AM | #37 |
Grand Sorcerer
Posts: 11,760
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Try
Code:
{comments:'contains($, 'Last Page Read:', re($, '(?is).*(\d\d-\d\d-\d\d\d\d).*?Last Page Read:.*', '\1'), 'Nope')'} |
01-19-2011, 06:39 AM | #38 |
Addict
Posts: 272
Karma: 1050426
Join Date: Feb 2010
Location: California
Device: iPad Mini w/Retina, Kindle 3, Kindle Fire HDX 8.9, & Asus Transformer
|
Do I place this in the documentation box of the template function? Sorry I'm really a new at this.
|
01-19-2011, 06:47 AM | #39 | |
Grand Sorcerer
Posts: 11,760
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
In general, templates begin with a { character or, rarely, the word 'program:'. Python code, the stuff that goes into the template functions dialog, begin with 'def evaluate'. It will be rare that someone provides a python template function, because so few people can understand and modify them. Templates are more easily modified by users, so you will see them more often. Pointer: you can edit a composite (column made from columns) custom column's template by clicking in the column and hitting F2. A dialog box will open in which you can change the template. This is far more convenient than editing the column definition. You might want to read calibre's template language manual http://calibre-ebook.com/user_manual/template_lang.html. That might give you some info about what it is the template is doing. |
|
01-19-2011, 07:10 AM | #40 |
Addict
Posts: 272
Karma: 1050426
Join Date: Feb 2010
Location: California
Device: iPad Mini w/Retina, Kindle 3, Kindle Fire HDX 8.9, & Asus Transformer
|
I placed this in the custom column and all of the comments section including the annotation was placed in the column. I was wanting just the date the book was read. Did I do something wrong?
Last edited by beckywc; 01-19-2011 at 07:12 AM. |
01-19-2011, 07:14 AM | #41 | |
Grand Sorcerer
Posts: 11,760
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Also copy one of the comments containing an annotation and post that. I don't have a kindle so I cannot see what it is you are dealing with. |
|
01-19-2011, 07:24 AM | #42 | |
Addict
Posts: 272
Karma: 1050426
Join Date: Feb 2010
Location: California
Device: iPad Mini w/Retina, Kindle 3, Kindle Fire HDX 8.9, & Asus Transformer
|
Quote:
{comments:'contains($, 'Last Page Read:', re($, '(?is).*(\d\d-\d\d-\d\d\d\d).*?Last Page Read:.*', '\1'), 'Not Read')'} And this is one of my comments contains: SUMMARY: A homely woman who fears she will never marry becomes a mail-order bride. The man she comes for rejects her but another offers her marriage. She accepts, not believing love will result from the union. Love, after all, is for beautiful women. Isn't it? 9/27/2010 Last Page Read: Location 4411 (99%) Thanks |
|
01-19-2011, 07:28 AM | #43 |
Grand Sorcerer
Posts: 11,760
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
The problem is that your first example uses '-' as the separator in the date, but the last example uses '/'. I didn't know that the slash format was possible, so didn't account for it.
Change the template to Code:
{comments:'contains($, 'Last Page Read:', re($, '(?is).*(\d\d[-/]\d\d[-/]\d\d\d\d).*?Last Page Read:.*', '\1'), 'Not Read')'} |
01-19-2011, 07:43 AM | #44 | |
Addict
Posts: 272
Karma: 1050426
Join Date: Feb 2010
Location: California
Device: iPad Mini w/Retina, Kindle 3, Kindle Fire HDX 8.9, & Asus Transformer
|
Quote:
When Dr. Whitney himself is murdered, Ryland has only one person left to trust: the beautiful Lily. Possessed of an uncanny sixth sense herself, Lily shares Ryland's every new fear, every betrayal, every growing suspicion, and every passionate beat of the heart. Together, they will be drawn deeper into the labyrinth of her father's past…and closer to a secret that someone would kill to keep hidden. 1/18/2011 Last Page Read: Location 5507 (99%) This one the date didn't show it still contains the comments and the annotation in the field. It's weird that some changed to just the date and some still has everything. |
|
01-19-2011, 07:56 AM | #45 | |
Grand Sorcerer
Posts: 11,760
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Try: Code:
{comments:'contains($, 'Last Page Read:', re($, '(?is).*\s(\d+[-/]\d+[-/]\d\d\d\d).*?Last Page Read:.*', '\1'), 'Not Read')'} |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"integrity error column book is not unique" | Atiajar | Calibre | 4 | 12-21-2010 11:22 PM |
Can Comments be "saved to disk" for reading? | sailingpeanut | Recipes | 1 | 10-10-2010 10:06 AM |
(2 books) in "On Device" column Sony Reader | phenomshel | Calibre | 23 | 09-19-2010 05:43 PM |
Bug? "Insert metadata as page at start of book" doesnt encode Comments field properly | rollercoaster | Calibre | 2 | 04-24-2010 10:40 PM |