05-12-2021, 02:32 PM | #1 |
Member
Posts: 21
Karma: 10
Join Date: Oct 2016
Device: Trekstor 3.0
|
Fill Series-Numbers with 000
Well, maybe I am the only one but I am sure I am not having this problem:
Imagine you have an ebook-series with e. g. 3000 items with ascending numbers. And you export what you own to have kind of a catalogue in Excel (or OpenOffice/LibreOffice). No my problem is that LibreOffice doesn't sort numbers "the right way" what means they look kind of 1.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 2.0 20.0 21.0 and so on. And especially when the number of items has for digits (or even more), I am never able to get a correct ascending (or descending) list in LibreOffice. So is there any possibility to "tell" Calibre - according to the highest number of any series - to fill the other ones with "Zeros" (000) at the beginning to have all with the same number of digits? So there wouldn't be a number 1.0 anymore but a 0001.0 As I got a load of series with at least 3 digits and some more with even 4 digits, help would be really appreciated to finally get correct ascending lists. Thanks in advance for your support! |
05-12-2021, 03:32 PM | #2 |
Evangelist
Posts: 401
Karma: 1597305
Join Date: Mar 2010
Device: Ipod G4, MacOS 10.12, Calibre, Pocketbook Touch HD 3
|
You can format the column in LibreOffice to have leading zeros.
https://help.libreoffice.org/6.2/en-...ding_zero.html I just tried it with Format / Cells and then selected a few leading zeros (from the options just below the decimal places bit). |
Advert | |
|
05-12-2021, 03:43 PM | #3 |
Wizard
Posts: 1,092
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
|
You can setup a composite column with the following template:
Code:
{series_index:0>6.2f} |
05-12-2021, 04:01 PM | #4 |
Member
Posts: 21
Karma: 10
Join Date: Oct 2016
Device: Trekstor 3.0
|
@capink: When I configure the colums for export I only see this.
How/Where could I add the composite column? Last edited by theducks; 05-12-2021 at 04:24 PM. Reason: Replaced hug inline image. Please read forum guidelines (and use attachments) |
05-12-2021, 04:03 PM | #5 |
Member
Posts: 21
Karma: 10
Join Date: Oct 2016
Device: Trekstor 3.0
|
@skb: Just imagine having countless series. And then doing a manual work for thousands of lines. If I can't get it done with the idea of capink, I might try, but I'd prefer getting the data in the correct format from Calibre before I need to change in LibreOffice
|
Advert | |
|
05-12-2021, 05:03 PM | #6 |
Wizard
Posts: 1,092
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
|
Preferences > Add your own columns (see attachment for more details)
|
05-12-2021, 05:54 PM | #7 |
Member
Posts: 21
Karma: 10
Join Date: Oct 2016
Device: Trekstor 3.0
|
@capink: Now it worked fine! That's THE ultimate solution! Many many thanks!
|
05-12-2021, 09:56 PM | #8 |
Member
Posts: 21
Karma: 10
Join Date: Oct 2016
Device: Trekstor 3.0
|
@capink: First I had hope... and it looks great in Calibre. A an example: I got one series, numbers 25.000 - 36.000 in Calibre - but after the export I got 25000 - 26000
But that's not the worst: For another series it works sometimes this way sometimes another: Number 1 - 9 are 1.0000 - 9.000 now but 10 - 99 are 10000 - 99000 and then 100 - 141 are 100.00 to 141.00 Sorry to say but this is totally confusing why one formula works on different ways and only partially delivers the results I need. Would you be so kind and explain that to me? |
05-13-2021, 05:37 AM | #9 | |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
If period is the decimal separator:
If your decimal separator is, for example, a comma then try the template Code:
{#series_index:'re(format_number($, '07.2f'), '\.' , ',')'} |
|
05-13-2021, 07:03 AM | #10 |
Member
Posts: 21
Karma: 10
Join Date: Oct 2016
Device: Trekstor 3.0
|
Seeing the look of my Calibre, üeriod IS the decimal separator. But I still can't understand why in Calibre I got the zeros once behind and once before the separator. I am quite sure that I created the column exactly the way of capinks example:
But one es confusing, which might make comma the separator: In the Calibre list I see it only this way "Series [number]" but if I open a book to change Metadata, in the "number"-Field there is always a number with ",00" (Komma Zero Zero). So I'll try to modify the column the way chaley adviced. Thanks for this new try! |
05-13-2021, 07:16 AM | #11 |
Member
Posts: 21
Karma: 10
Join Date: Oct 2016
Device: Trekstor 3.0
|
Okay, new try, first happiness and another load of confusion:
This formula {#series_index:'re(format_number($, '07.2f'), '\.' , ',')'} didn't work ("Error in the Original") until I took out "#" Now the numbers look absolutely great - but only in Calibre! Then I recognized that this is a problem of LibreOffice: When clicking on the CSV, in the preview the column looks great (0001,00 instead of 1) but as soon as I go the next step, its a simply "1" again. So I just decided - in the preview of the csv - making this column text instead of numbers and it worked! Now open I see 0001,00 and so on and so far it looks fine. If I got further problems, I'll be back^^ |
05-13-2021, 04:59 PM | #12 | |
Evangelist
Posts: 401
Karma: 1597305
Join Date: Mar 2010
Device: Ipod G4, MacOS 10.12, Calibre, Pocketbook Touch HD 3
|
Quote:
Having said that, you don't have to do the formatting for "thousands of lines" in LO. Just select the whole column. Job done. Yes, I may be a spreadsheet tragic, sorry ;-) |
|
Tags |
fit number of digits |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Nexus 4 sales estimated at 375,000 by enthusiasts decoding serial numbers | Top100EbooksRank | News | 103 | 01-31-2013 05:07 PM |
Series numbers | Jane A | Calibre | 2 | 11-26-2011 07:30 PM |
Series Numbers for long series | Justy | Calibre | 2 | 04-21-2011 01:57 AM |
Parse book titles to fill in series in Calibre library | Marcika | Calibre | 1 | 11-25-2009 05:35 PM |
Reference Unknown: The First 100,000 Prime Numbers. v1. 11 Dec. 08 | Dr. Drib | BBeB/LRF Books | 9 | 12-12-2008 06:24 PM |