Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 02-19-2014, 06:16 AM   #1
Khan-Dam
Enthusiast
Khan-Dam began at the beginning.
 
Posts: 40
Karma: 10
Join Date: Jul 2011
Location: France
Device: iPad, Kindle 3, Kobo Glo, Kobo Aura
Question Apply Functions on a column on a set of select row

Hi,

I'm seeking a solution for this problem

I have a custom Column type number with coma and for any reason i would add a value for theese cell after selected some row in the library

exemple :

in column Indice a have
Sel Indice | Book
> 1 | a book
> 6 | book 2
3 | book 3
> 9 | book 4

after applying add 2 for column indice on selected 1,2 and 4 book i would obtain :
> 3 | a book
> 8 | book 2
3 | book 3
> 11 | book 4

and the same thing on a colum type like serie with index

Is there an existing solution in calibre or this must done by a plug-in ?

thank in advance

regards

Khan-Dam
Khan-Dam is offline   Reply With Quote
Old 02-19-2014, 07:34 AM   #2
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,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
If I understand correctly what you want to do (not sure), then you can do it with global search & replace. The attached screen capture shows how. It adds two to the #myint field for every book selected.
Attached Thumbnails
Click image for larger version

Name:	Clipboard04.jpg
Views:	233
Size:	109.8 KB
ID:	119263  
chaley is offline   Reply With Quote
Advert
Old 02-19-2014, 09:02 AM   #3
Khan-Dam
Enthusiast
Khan-Dam began at the beginning.
 
Posts: 40
Karma: 10
Join Date: Jul 2011
Location: France
Device: iPad, Kindle 3, Kobo Glo, Kobo Aura
Yes it's exactily what i need

thank you very much for that

i seek for a long time to do but i don't understand exactly that i can make without find and replace field in regular expression

it make's me gain a lot of time when i maintain library

is it possible to make same thing with adding something from the value in the column of the previous row

#myint = #myint ( from previous row) + 1


regards

Last edited by Khan-Dam; 02-19-2014 at 09:10 AM.
Khan-Dam is offline   Reply With Quote
Old 02-19-2014, 10:14 AM   #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,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Khan-Dam View Post
is it possible to make same thing with adding something from the value in the column of the previous row

#myint = #myint ( from previous row) + 1


regards
No. The template language can "see" only the current book. The is no way to use the metadata from book A while processing book B.

You can do that sort of thing in a plugin, because it has access to the complete database and the complete selection list.
chaley is offline   Reply With Quote
Old 02-19-2014, 01:43 PM   #5
Khan-Dam
Enthusiast
Khan-Dam began at the beginning.
 
Posts: 40
Karma: 10
Join Date: Jul 2011
Location: France
Device: iPad, Kindle 3, Kobo Glo, Kobo Aura
Thanks a Lot

Regard from France
Khan-Dam is offline   Reply With Quote
Advert
Reply

Tags
function, library managment, python


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A way to have column w Fixed set o values but not alphabeticaly sorted ? Riva3000 Library Management 9 09-21-2013 06:03 PM
Set value of another column from composite? dirgeon Library Management 1 02-03-2013 11:40 AM
Using OnDevice to set the value of a custom column WendyR14 Library Management 3 10-23-2011 08:03 PM
Feature request - have tags set background colour of row KPHarg Calibre 5 01-01-2010 12:44 AM


All times are GMT -4. The time now is 04:34 PM.


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