Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 06-05-2020, 06:12 AM   #1
RobertKoval
Junior Member
RobertKoval began at the beginning.
 
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.
Attached Thumbnails
Click image for larger version

Name:	01_original_names.png
Views:	962
Size:	7.0 KB
ID:	179729   Click image for larger version

Name:	02_prefix_sample.png
Views:	958
Size:	12.1 KB
ID:	179730   Click image for larger version

Name:	03_suffix_sample.png
Views:	920
Size:	11.5 KB
ID:	179731  
RobertKoval is offline   Reply With Quote
Old 06-05-2020, 12:56 PM   #2
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by RobertKoval View Post
I suspect that this option is not currently available [Sigil 1.2.0] (except for manual adding).
You can use the built-in RegExRename option to insert text in existing file names, but you can't insert running counters.

Quote:
Originally Posted by RobertKoval View Post
Or maybe with a plugin? That would probably be the best idea.
Not really, because such a plugin would have to update all file references, which would require a lot of effort for little benefit.
Doitsu is offline   Reply With Quote
Advert
Old 06-05-2020, 02:42 PM   #3
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is online now   Reply With Quote
Old 06-05-2020, 06:26 PM   #4
RobertKoval
Junior Member
RobertKoval began at the beginning.
 
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 …
  • cover.xhtml
  • titlepage.xhtml
  • copyright.xhtml

… using RegExRename to get …
  • cover-something.xhtml
  • titlepage-something.xhtml
  • copyright-something.xhtml

... but numbering will delete the original name:
  • something-01.xhtml
  • something-02.xhtml
  • something-03.xhtml
However, if there is such a possibility – I will gladly wait for answer.

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:
Many people spend hours clicking and typing to perform repetitive tasks, unaware that the machine they're using could do their job in seconds if they gave it the right instructions.
I searched the MR forum and found a few posts that mention that using plugins you can't rename files. So I understand that this is not possible (although I'd love to be wrong).
RobertKoval is offline   Reply With Quote
Old 06-05-2020, 06:56 PM   #5
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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?
KevinH is online now   Reply With Quote
Advert
Old 06-06-2020, 02:03 AM   #6
RobertKoval
Junior Member
RobertKoval began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2014
Device: PW2
I do just that! I was just looking for a faster solution.
RobertKoval is offline   Reply With Quote
Old 06-06-2020, 10:14 AM   #7
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is online now   Reply With Quote
Old 06-06-2020, 10:28 AM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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
here also. Why?
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?
theducks is online now   Reply With Quote
Old 06-08-2020, 11:33 PM   #9
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 681
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by theducks View Post
And WHY do you need an ISBN included? Are you splitting work, then re-merging the pieces?
Many publishers do that. Quite annoying as I have to widen the browser pane just to distinguish the filenames. If I'm doing anything to one I would rename them all to "chap01" or similar style.

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.
AlanHK is offline   Reply With Quote
Old 06-11-2020, 05:33 PM   #10
RobertKoval
Junior Member
RobertKoval began at the beginning.
 
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.
RobertKoval is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 01:21 PM.


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