![]() |
#1 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Dec 2014
Device: PW2
|
Adding prefix and suffix to file names
For a long time the question bothers me: can you change the file name in Sigil, and add a prefix with numbering?
Of course, I know about the possibility of adding a numbered suffix, but then the name is replaced with a new one. With the help of the wonderful ReRename, I can add something before or after the name using regular expressions and thank you very much for this opportunity. But my problem is different. I would like to add some repetitive string to the existing name, plus numbering. I will demonstrate this with the best example. Here are the original names: I would like to be able to add numbering (prefix): numbering + any string + original filename or suffix: original filename + any string + numbering I suspect that this option is not currently available [Sigil 1.2.0] (except for manual adding). Is this type of rename possible to implement? Or maybe with a plugin? That would probably be the best idea. |
![]() |
![]() |
![]() |
#2 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Not really, because such a plugin would have to update all file references, which would require a lot of effort for little benefit. |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,760
Karma: 5706256
Join Date: Nov 2009
Device: many
|
You can also renumber files in naming. I do not have access to Sigil right now to remember how. But by selective renumbering and using Regex rename, you should be able to get something reasonable.
|
![]() |
![]() |
![]() |
#4 | |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Dec 2014
Device: PW2
|
Thank you for both answers.
I tried in different ways, but automatic numbering (which I have been using for years) always deletes the original name. So I can from such names …
… using RegExRename to get …
... but numbering will delete the original name:
On the other hand – I understand perfectly what Doitsu mentioned, that each change of file names requires checking the entire file structure and inserting new names each time in all places. But the plugins are just for that! I will quote from the Automate the Boring Stuff with Python book: Quote:
|
|
![]() |
![]() |
![]() |
#5 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,760
Karma: 5706256
Join Date: Nov 2009
Device: many
|
Plugins have no interface to rename as the code to do that and update all of the links properly is inside Sigil not in the plugin code.
Why can you just use Regex Rename with a selected set of files (not all of them) to add your desired prefix? Similarly, have you tried highlighting just the chapter files to renumber and renumber them then select those to add the prefix with Regex Renamer? |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Dec 2014
Device: PW2
|
I do just that! I was just looking for a faster solution.
|
![]() |
![]() |
![]() |
#7 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,760
Karma: 5706256
Join Date: Nov 2009
Device: many
|
Why? That is not a very common problem to solve. In fact, I strip out the prefixes and suffixes when starting to clean most books as they normally start with a "digit" or non-common character, add no value, do not help protect the book contents in any way, add wasted size to all links, add wasted space to the epub, etc.
|
![]() |
![]() |
![]() |
#8 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
![]() The device does not care. The standard Sequential: Section### allows you to put things back in order if you manage to destroy the OPF . And WHY do you need an ISBN included? Are you splitting work, then re-merging the pieces? |
![]() |
![]() |
![]() |
#9 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 681
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
When you are importing files from one book to another, it is useful to have a unique prefix, but the ISBN is just too long. |
|
![]() |
![]() |
![]() |
#10 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Dec 2014
Device: PW2
|
Thank you very much for all comments. After thinking about the matter, I decided that this function is not really that important. If necessary, I can change these several or several files manually or semi-automatically with the help of existing Rename and RegEx Rename functions.
For clarification: Indeed, adding prefixes in the form of numbers or ISBNs to file names is not my invention, but the editorial department in a publishing house that wants to maintain "order" in its digital publications. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
PDF Files; Metadata & File Names; Adding Physical Book Info | Thunder_Struck | Calibre | 4 | 02-13-2019 11:16 PM |
Kobo Collections from Calibre column names with prefix? | rhalina | Kobo Reader | 12 | 01-07-2018 06:59 PM |
How to use file names as metadata when adding books | user743 | Library Management | 9 | 04-28-2014 10:45 AM |
adding names | wjt | Library Management | 1 | 05-19-2012 08:12 PM |
[Bug?] Field(s) in prefix/suffix | Backi | Library Management | 5 | 03-13-2012 06:22 AM |