Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-02-2019, 08:49 PM   #1
taneal1
Member
taneal1 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Feb 2012
Device: Nook
Sigil Rename Command

Using the Search function I can't find anything even remotely close to answering this question...

The book I am editing has 100+ image files [located in the "IMAGES" folder] in the following format:
Pict_statesecret_ch2_castroandcubela.jpg
Pict_statesecret_ch2_cuba.jpg

What I'd like to do is remove the "Pict_statesecret_" from the filename while leaving the "ch2_XXXXXX.jpg" in place, using the "RENAME" command.

Is this possible?

Thanks for any thoughts,

Tom
taneal1 is offline   Reply With Quote
Old 03-03-2019, 08:30 AM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
The only mass-renaming feature Sigil has requires you to set a base name and a starting position. You accomplish this by selecting the multiple files in Sigil's Book Browser and then right-clicking and selecting "Rename" from the context menu. You'll then be presented with dialog to choose the start name. If you enter image0001. all files will be renamed starting with 0001 and increasing from there (the existing extensions will be preserved). Mousing over the label on the dialog box will give you tips of how the mass renaming works.

But as far as what you want to do ... I'm afraid the answer is no. Sigil has no mass rename functionality which will allow you to delete only the prefix from a group of similarly named files.

Last edited by DiapDealer; 03-03-2019 at 08:32 AM.
DiapDealer is online now   Reply With Quote
Old 03-03-2019, 09:41 AM   #3
Springbok
Enthusiast
Springbok began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jan 2018
Device: Kindle Touch
Slightly different question but more less on the same subject. I use the mass rename of filenames often and for me the current sigil functionality is not perfect but quite sufficient. However I haven't found a way to do the same for file extension (eg. make a bulk rename of html into xhtml while the filenames remain unchanged). Is there a way to do it?
Springbok is offline   Reply With Quote
Old 03-03-2019, 10:06 AM   #4
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,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Springbok View Post
Slightly different question but more less on the same subject. I use the mass rename of filenames often and for me the current sigil functionality is not perfect but quite sufficient. However I haven't found a way to do the same for file extension (eg. make a bulk rename of html into xhtml while the filenames remain unchanged). Is there a way to do it?
Simply select all files, right-click and enter .xhtml.
Doitsu is offline   Reply With Quote
Old 03-03-2019, 10:26 AM   #5
Springbok
Enthusiast
Springbok began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Jan 2018
Device: Kindle Touch
Thanks Doitsu. Indeed, it is so simple that I feel silly I haven't found the answer myself. I have tried *.xtml approach earlier but that didn't work.
Springbok is offline   Reply With Quote
Old 03-03-2019, 10:37 AM   #6
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
I hope this reply is not going beyond the scope of this forum: If you want to rename the filenames themselves before they are imported into Sigil then you can use a piece of free software called Advanced Renamer. This is available from https://www.advancedrenamer.com/. Use this to rename your files, then when the images are imported into Sigil the names of the images in Sigil will match those of your external filenames.
CalibUser is offline   Reply With Quote
Old 03-03-2019, 03:39 PM   #7
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: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by CalibUser View Post
I hope this reply is not going beyond the scope of this forum: If you want to rename the filenames themselves before they are imported into Sigil then you can use a piece of free software called Advanced Renamer. This is available from https://www.advancedrenamer.com/. Use this to rename your files, then when the images are imported into Sigil the names of the images in Sigil will match those of your external filenames.
Are you sure this wont break ALL the linkages inside the HTML code
When you use Sigils rename, it adjusts ALL references (usage) in the book, to match the new name
theducks is offline   Reply With Quote
Old 03-03-2019, 04:08 PM   #8
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,568
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by theducks View Post
Are you sure this wont break ALL the linkages inside the HTML code
When you use Sigils rename, it adjusts ALL references (usage) in the book, to match the new name


Quote:
Originally Posted by CalibUser View Post
... If you want to rename the filenames themselves before they are imported into Sigil then...
BR
BetterRed is online now   Reply With Quote
Old 03-03-2019, 09:13 PM   #9
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,400
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by theducks View Post
Are you sure this wont break ALL the linkages inside the HTML code
When you use Sigils rename, it adjusts ALL references (usage) in the book, to match the new name
Doing this to already imported images does break all the links. The one time I did this, I extracted the image files, renamed and re-injected them. I then used regex to do a search and replace on the old file names and replace them with the new file name on "all files" plus "current file" for content.opf. It was a bit easier than manually renaming 300 image files.

Something like (using the filename segment from taneal1):
Code:
search Pict_statesecret_(.*?)\.jpg
replace: \1.jpg
OTOH, the suggestion was doing this before importing files which is a bit hard when the files already exist in the epub.

OYAH, in future, I'm going to avoid this type of task. I wasn't the author who added the entire flipping path to the original image directory on his computer as part of the filename.
DNSB is offline   Reply With Quote
Old 03-04-2019, 12:15 PM   #10
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
Quote:
Originally Posted by theducks View Post
Are you sure this wont break ALL the linkages inside the HTML code
When you use Sigils rename, it adjusts ALL references (usage) in the book, to match the new name
Just to clarify: You need to use Advance Rename before importing the files into Sigil. Then the names of the images in Sigil and the names of the external files will match. You can then set up the html linkages for the images.

If you import the images and set up the html links to them, then use Advance Renamer to change the names of the external files and import these renamed files into Sigil, then you will lose your html links to the images.

I hope this clarifies the issue raised.
CalibUser is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to execute a non-root command without access to command line Galunid Kindle Developer's Corner 4 05-15-2018 07:50 PM
Find and Rename words in 10 Files simultaneously with Sigil iki1lu4fun Sigil 7 01-24-2015 01:17 AM
Sigil on Nook vs Sigil on Kobo vs Sigil on iBook rosshalde Sigil 12 11-13-2014 09:34 AM
rename filename? Lauraq Calibre 5 07-30-2014 04:42 AM
whishlist: button/command edit in Sigil booksonthemove Calibre 3 03-03-2010 06:30 AM


All times are GMT -4. The time now is 01:36 AM.


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