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 07-30-2011, 01:23 AM   #1
HDvision
Junior Member
HDvision began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jul 2011
Device: IPad
Save to disk (file names)

Hello,

i tried everything
but when it comes to save my files to disk, following will happen:

i use: {author_sort}/{series} - {series_index} - {title} - {authors} - {isbn}

because i want to have:

SERIE - NO. - BOOK NAME - AUTHOR - ISBN

all fine WHEN the book has a SERIE

BUT IF NOT

the file name is like this:

- - SERIE - NO- BOOK NAME - AUTHOR - ISBN

i dont want those two " - - " at the beginning.

how can i remove them?

thanks a lot
HDvision is offline   Reply With Quote
Old 07-30-2011, 02:54 AM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by HDvision View Post
i dont want those two " - - " at the beginning.
how can i remove them?
Try the following.

Code:
{author_sort}/{series:||-}{series_index:re(^(\d)(\.|$),0\1\2)||-}{title}-{authors}-{isbn}
DoctorOhh is offline   Reply With Quote
Advert
Old 07-30-2011, 03:25 AM   #3
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
@dwanthny: why use 're' to add the leading zero instead of using something like 05.2f as the number format string? Are you ensuring that ".00" (or something like it) isn't added to integer series numbers?
chaley is offline   Reply With Quote
Old 07-30-2011, 03:34 AM   #4
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by chaley View Post
@dwanthny: why use 're' to add the leading zero instead of using something like 05.2f as the number format string? Are you ensuring that ".00" (or something like it) isn't added to integer series numbers?
I have to plead ignorant. I copied this from this forum ages ago and in the rare times I use it I seems to produce what I desire.
DoctorOhh is offline   Reply With Quote
Old 07-30-2011, 03:51 AM   #5
HDvision
Junior Member
HDvision began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jul 2011
Device: IPad
hello dwanthny, thank you so much, i have no glue WHY it WORKS, but it does

i changed it a little to get spaces:

{author_sort}/{series:|| -} {series_index:re(^(\d)(\.|$),0\1\2)|| -} {title} - {authors} - {isbn}




@chaley
u mean i can shorten the template?
i mean it does already what i want it to do
so what would be the advantage from changing the thing with 're'?
dont even know what it means
HDvision is offline   Reply With Quote
Advert
Old 07-30-2011, 04:23 AM   #6
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 HDvision View Post
u mean i can shorten the template?
i mean it does already what i want it to do
so what would be the advantage from changing the thing with 're'?
dont even know what it means
The 're' adds a leading zero to series indices that are 1 digit long. For example, an index of '5' will be changed to '05', while an index of '15' will be left alone. If you don't want this behavior, then you can use
Code:
{author_sort}/{series:|| -} {series_index:|| -} {title} - {authors} - {isbn}
My question related to how the leading zero was being added. A different solution is to use a format specification that ensures that the series indices have a fixed look. For example,
Code:
{author_sort}/{series:|| -} {series_index:05.2f|| -} {title} - {authors} - {isbn}
will produce the following output for the given series indices:
1 -> 01.00
1.4 -> 01.40
10 -> 10.00
14.43 -> 14.43

Also note that your template will put an extra space after the slash if there is no series or series index, and will have an extra trailing - if there is no ISBN. You probably want to use
Code:
{author_sort}/{series:|| - }{series_index:|| - }{title} - {authors}{isbn:| - |}
As for why it works: if a template element is not empty, then the text after the first | is inserted before the value and the text after the second | is appended after the value. If the template element is empty, then no text is inserted or appended. Thus if a book has an ISBN, a " - " is inserted before it. If the book has no ISBN, then nothing is inserted.

Last edited by chaley; 07-30-2011 at 04:26 AM.
chaley is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Save on disk PhM Calibre 1 06-13-2011 12:43 PM
Save to Disk beckywc Library Management 3 06-06-2011 08:54 PM
Save to Disk Series Help DoctorOhh Calibre 7 04-21-2010 07:46 AM
Save to Disk now saving file with full path? Mnementh Calibre 3 09-14-2009 01:24 AM
Any way to not have Caliber add numbers to file names when saving to disk JGB Calibre 13 12-09-2008 04:35 PM


All times are GMT -4. The time now is 02:14 PM.


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