Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 12-04-2018, 01:02 PM   #1231
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
Quote:
Originally Posted by davidfor View Post
But, what I meant is that if you don't want to use the locale default, you can use a comma easily, but, getting any other character is hard.
OK, if we do not want to use 'n', it is necessary to create a custom column based on the custom column associated with the Count pages plugin (this should have the format {:,}).
In the new column the template will be:
Code:
{#pages:re(\,,.)}
In this example the new character is a dot, but we can put the character we want.
Honestly I do not see that this is hard or complicated.
jbacelar is offline   Reply With Quote
Old 12-04-2018, 06:55 PM   #1232
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by jbacelar View Post
OK, if we do not want to use 'n', it is necessary to create a custom column based on the custom column associated with the Count pages plugin (this should have the format {:,}).
In the new column the template will be:
Code:
{#pages:re(\,,.)}
In this example the new character is a dot, but we can put the character we want.
Honestly I do not see that this is hard or complicated.
No, that is not hard at all. But, I said, "without writing extra code". And I had previously stated I couldn't see how to do it without an extra column. That was what I was really hoping to avoid as it feels like overkill. It also means that for every column you don't want the standard formatting, you need a second column with this template. And that's ugly and I was hoping to avoid.
davidfor is offline   Reply With Quote
Old 12-04-2018, 07:49 PM   #1233
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,556
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by davidfor View Post
No, that is not hard at all. But, I said, "without writing extra code". And I had previously stated I couldn't see how to do it without an extra column. That was what I was really hoping to avoid as it feels like overkill. It also means that for every column you don't want the standard formatting, you need a second column with this template. And that's ugly and I was hoping to avoid.
Would it be possible to write a template function (see Preferences->Advanced->Template functions) that formats numbers with commas and a period in the anglo-normal way, and does the regex to change the comma's into space and the period (if any) into a comma.

Then use that template in integer and float column definitions.

BR

Last edited by BetterRed; 12-04-2018 at 08:58 PM.
BetterRed is online now   Reply With Quote
Old 12-04-2018, 11:10 PM   #1234
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by BetterRed View Post
Would it be possible to write a template function (see Preferences->Advanced->Template functions) that formats numbers with commas and a period in the anglo-normal way, and does the regex to change the comma's into space and the period (if any) into a comma.

Then use that template in integer and float column definitions.
I don't know. The formatting appears to just be calling a Python format function. I don't know if that can be extended in a way that it can be used here.
davidfor is offline   Reply With Quote
Old 12-05-2018, 04:58 AM   #1235
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,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BetterRed View Post
Would it be possible to write a template function (see Preferences->Advanced->Template functions) that formats numbers with commas and a period in the anglo-normal way, and does the regex to change the comma's into space and the period (if any) into a comma.

Then use that template in integer and float column definitions.

BR
Quote:
Originally Posted by davidfor View Post
I don't know. The formatting appears to just be calling a Python format function. I don't know if that can be extended in a way that it can be used here.
Davidfor is correct, the format string isn't a template. It is instead the part of a template that affects how the value is formatted.

That could be changed (process the format as a template). That would require some syntax to tell calibre that the string is a full template instead of a simple format string, perhaps something like a leading colon. It also would be a bit slower, but probably not significantly.

The real question: is the worth doing? Would more than one person use it?
chaley is offline   Reply With Quote
Old 12-05-2018, 05:48 AM   #1236
Sarmat
Enthusiast
Sarmat began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Nov 2018
Device: Kindle Paperwhite 2
Quote:
Originally Posted by JimmXinu View Post
This is what I have:

Code:
{:,}
thanks
now it's much better
Sarmat is offline   Reply With Quote
Old 12-10-2018, 11:12 AM   #1237
Sarmat
Enthusiast
Sarmat began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Nov 2018
Device: Kindle Paperwhite 2
is it possible to add one more function?
to calculate hours which are needed to read a book based on inserted value of average reading speed

seeing hours instead of pages is much more useful
Sarmat is offline   Reply With Quote
Old 12-10-2018, 10:13 PM   #1238
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Sarmat View Post
is it possible to add one more function?
to calculate hours which are needed to read a book based on inserted value of average reading speed

seeing hours instead of pages is much more useful
As all you want is something like "pages / pages-per-hour", or "words / words-per-hour", you can create another column to display this. It has been discussed before with some examples of how to do it. A search through the thread should find it.
davidfor is offline   Reply With Quote
Old 12-14-2018, 04:30 AM   #1239
red_dragon
Daywalker
red_dragon is on a distinguished road
 
Posts: 29
Karma: 52
Join Date: Jul 2008
Device: Kindle Paperwhite
Sarmat,

I am using the code from Post #1110. Two posts earlier you will find a description how to add a custom column.

Different colors based on book length are also handy. You you can adjust them in Preferences -> "Look & Feel", "Column Coloring".
red_dragon is offline   Reply With Quote
Old 12-14-2018, 06:27 AM   #1240
Sarmat
Enthusiast
Sarmat began at the beginning.
 
Posts: 38
Karma: 10
Join Date: Nov 2018
Device: Kindle Paperwhite 2
red_dragon,

thank you, nice
Sarmat is offline   Reply With Quote
Old 02-08-2019, 07:05 PM   #1241
mrpops
Member
mrpops began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Feb 2019
Device: Kindle
Just thought i'd post in this thread because i've spent the last hour trying to figure out why it wouldn't work, yet others had success doing the seemingly exact same thing.

If you are exporting / converting to .kfx theres a setting in the exporter that you need to change.

Click on preferences > output options > KFX output > 3rd option 'create approximate page numbers' and change the column to #pages or whatever you put.

You need to enable this column to match the #pages column like is mentioned at the start, because .kfx exports need to, for whatever reason. So simply just click that and put #pages for the column its from and everything will work like it should.

Hopefully this saves someone else an hour or so.

Thank you to everybody who has contributed, this looks so much cleaner than location.
mrpops is offline   Reply With Quote
Old 05-04-2019, 11:11 PM   #1242
jtww
Junior Member
jtww began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2019
Device: none
Hi, I hope this is the right place to ask:

I just wanted to know the word count for a specific book. So this is what I did:

1. I imported the book into the calibre library
2. I installed this Count Pages plugin & checked the option to have it in the context menu
3. I restarted Calibre to activate the plugin
4. I right-clicked the book > Count Pages > Estimate Word/Page Counts

Now I'm seeing the error: You must specify custum column(s) first. Do you want to configure this now?

There are two things that threw me a bit for a loop, and which I suggest might be worth changing:

1. First of all, why do I need to have a permanent column for this just to see it once? I really just wanted to see it for that one book, but when I click "No" in that dialog I don't get some prompt with the info but just nothing

2. When I click "Yes" and I get to the plugin preferences, I have a lot of sections which each have a "Custom column" chooser - with zero options / just one empty entry. I can't actually set any custom column here, so what am I even supposed to do? (Is this a bug? If not, some sort of explanation of what it wants me to do in that dialog could be helpful)

Apart from that, thanks so much for providing this plugin! It is so useful to have this functionality, I just wish the way to get there was a little easier
jtww is offline   Reply With Quote
Old 05-04-2019, 11:26 PM   #1243
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,556
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by jtww View Post
Hi, I hope this is the right place to ask:

I just wanted to know the word count for a specific book. So this is what I did:

1. I imported the book into the calibre library
2. I installed this Count Pages plugin & checked the option to have it in the context menu
3. I restarted Calibre to activate the plugin
4. I right-clicked the book > Count Pages > Estimate Word/Page Counts

Now I'm seeing the error: You must specify custum column(s) first. Do you want to configure this now?

There are two things that threw me a bit for a loop, and which I suggest might be worth changing:

1. First of all, why do I need to have a permanent column for this just to see it once? I really just wanted to see it for that one book, but when I click "No" in that dialog I don't get some prompt with the info but just nothing

2. When I click "Yes" and I get to the plugin preferences, I have a lot of sections which each have a "Custom column" chooser - with zero options / just one empty entry. I can't actually set any custom column here, so what am I even supposed to do? (Is this a bug? If not, some sort of explanation of what it wants me to do in that dialog could be helpful)

Apart from that, thanks so much for providing this plugin! It is so useful to have this functionality, I just wish the way to get there was a little easier
If its just a one off, and you have the book in ePub or azw3 format open it in the Book Editor, the Word Count is available from Tools->Reports->Words

Customs columns must be added in Preferences->Add your own columns

The values are stored so that they can be sent to devices, inserted into book jacket pages etc.

BR
BetterRed is online now   Reply With Quote
Old 05-05-2019, 01:56 AM   #1244
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by jtww View Post
Hi, I hope this is the right place to ask:

I just wanted to know the word count for a specific book. So this is what I did:

1. I imported the book into the calibre library
2. I installed this Count Pages plugin & checked the option to have it in the context menu
3. I restarted Calibre to activate the plugin
4. I right-clicked the book > Count Pages > Estimate Word/Page Counts

Now I'm seeing the error: You must specify custum column(s) first. Do you want to configure this now?

There are two things that threw me a bit for a loop, and which I suggest might be worth changing:

1. First of all, why do I need to have a permanent column for this just to see it once? I really just wanted to see it for that one book, but when I click "No" in that dialog I don't get some prompt with the info but just nothing

2. When I click "Yes" and I get to the plugin preferences, I have a lot of sections which each have a "Custom column" chooser - with zero options / just one empty entry. I can't actually set any custom column here, so what am I even supposed to do? (Is this a bug? If not, some sort of explanation of what it wants me to do in that dialog could be helpful)

Apart from that, thanks so much for providing this plugin! It is so useful to have this functionality, I just wish the way to get there was a little easier
Firstly, any tool you use needs to be configured. And the instructions for doing this are in the first post. But, having a button in the configuration dialog to create the custom columns would be handy, and I'll put it on the TODO list. But, it won't be something I'm rushing to do.

As to "one off" usage, are you going to remember the page or word count tomorrow? Plus, what about all the other books in your library. The plugin counts the words and stores them for all the books you select. You can then sort or select based on the values. Or send them to a device, or put them in a catalog.
davidfor is offline   Reply With Quote
Old 05-05-2019, 07:04 AM   #1245
jtww
Junior Member
jtww began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2019
Device: none
Hi, thanks for all the responses!

As for the one-off use, I just wanted to know the ballpark for a single book to compare it to another - and I assume that's not the most common use case, so I understand the confusion but that is what I wanted to do

I had previously no idea custom columns even existed, and I actually tried around to add one but couldn't make it show up in the preferences dialog since frankly, I just have no good clue on how they even work. I know most users would want to permanently set up one, but it'd be nice if for a one-off check that wouldn't be necessary

I also had no idea the book editor existed, I'm really not that much of a power user. I get how the plugin works makes sense for power users, it's just a little confusing for beginners right now. Being able to see the info without being required to set up a custom column to display it permanently would help with that

One additional place I checked was the book metadata/detail info dialog but I couldn't see it there, maybe it'd be possible to add the info there as well? Just to make it a little easier to find for folks who didn't configure a custom column and aren't looking to do so
jtww is offline   Reply With Quote
Reply

Tags
count, count pages, page count, pages, plugin


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Quality Check kiwidude Plugins 1184 04-17-2024 06:17 PM
[GUI Plugin] Open With kiwidude Plugins 403 04-01-2024 08:39 AM
[GUI Plugin] Quick Preferences kiwidude Plugins 62 03-16-2024 11:47 PM
[GUI Plugin] Kindle Collections (old) meme Plugins 2070 08-11-2014 12:02 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 07:22 PM.


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