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-18-2024, 04:04 PM   #1
oles
Junior Member
oles began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2024
Device: Kobo
recover the size in bytes only of epub files

Good morning,

I use the formula below, but it shows me:
EPUB:1182150,KEPUB:701399

but I only want to have the epub and the size in bytes like this:
1182150


The current formula is:
{:'formats_sizes()'}

Do you have a tip? It seems to be python, but I didn't succeed with things proposed by chatgpt (lol) like:
{:'formats_sizes().get("EPUB")'}
{#formats.contains('EPUB') ? formats_sizes('EPUB'): ''}



THANKS
oles is offline   Reply With Quote
Old 09-18-2024, 04:34 PM   #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,947
Karma: 7225107
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
The template language documentation is at https://manual.calibre-ebook.com/template_lang.html. It isn't remotely python.

This Template Program Mode template does what I think you want.
Code:
{:'select(formats_sizes(), 'EPUB')'}
You might prefer this one that gives the size in kb or mb:
Code:
{:'human_readable(select(formats_sizes(), 'EPUB'))'}
Or perhaps this one that adds commas to the size:
Code:
{:'format_number(select(formats_sizes(), 'EPUB'), ',d')'}
chaley is offline   Reply With Quote
Old 09-19-2024, 07:38 AM   #3
oles
Junior Member
oles began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2024
Device: Kobo
Quote:
Originally Posted by chaley View Post
The template language documentation is at https://manual.calibre-ebook.com/template_lang.html. It isn't remotely python.

This Template Program Mode template does what I think you want.
Code:
{:'select(formats_sizes(), 'EPUB')'}
You might prefer this one that gives the size in kb or mb:
Code:
{:'human_readable(select(formats_sizes(), 'EPUB'))'}
Or perhaps this one that adds commas to the size:
Code:
{:'format_number(select(formats_sizes(), 'EPUB'), ',d')'}

Thank you, that work perfectly.
oles is offline   Reply With Quote
Reply

Tags
column settings, formula, python function, regex-function


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Caliber 64Bit size limit on EPUB Files? KEPutnam Calibre 4 02-21-2021 05:25 PM
Trimming .epub and .mobi files for size? FlyHero Reading and Management 7 03-05-2018 07:03 PM
find and remove zero size .epub files? hank Library Management 25 07-03-2015 11:13 AM
Reducing the size of epub files? Corpsegoddess ePub 8 01-09-2013 08:14 PM
'utf8' codec can't decode bytes error (HTML to EPUB conversion) gsz Calibre 10 10-26-2009 06:29 PM


All times are GMT -4. The time now is 05:23 AM.


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