|
|||||||
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Connoisseur
![]() Posts: 95
Karma: 10
Join Date: Jul 2023
Device: none
|
Is there a simple way to replace all spaces in file names with _ in the book browser?
The best I've come up with is to have the strings below in a text editor and then copy and paste them each time into regex rename.
(.*) (.*) (.*) \1_\2_\3 (.*) (.*) \1_\2 |
|
|
|
|
|
#2 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,208
Karma: 6565382
Join Date: Nov 2009
Device: many
|
What generates the spaces into file names? I rarely if ever encounter spaces anymore in files names inside epubs.
Assuming this is a common problem, you can use a file base name and automagically number files in BookBrowser around that base which I commonly use for Chapters leaving only front matter and end matter to hand edit the names for but that changes the root name of the file. Using Regex Rename is probably the easiest way to preserve parts of existing file names. Have you tried using (\s) at the Regular Expression and _ as the Replacement? Seems to work for me. Last edited by KevinH; 01-09-2026 at 06:17 PM. |
|
|
|
|
|
#3 |
|
Enthusiast
![]() Posts: 39
Karma: 10
Join Date: Jun 2011
Location: Lima, Peru
Device: Kindle 10Gen / Kobo Aura HD / Nook STR
|
Indeed.
But you don't need to capture the search. And better with “+”, just in case: Code:
\s+ _ |
|
|
|
|
|
#4 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,208
Karma: 6565382
Join Date: Nov 2009
Device: many
|
|
|
|
|
|
|
#5 |
|
Connoisseur
![]() Posts: 95
Karma: 10
Join Date: Jul 2023
Device: none
|
Thank you. I looked at the example in the manual and made the wrong assumption that I needed to recreate the entire new file name. This might be another good example if someone wants to add it to the manual.
|
|
|
|
|
|
#6 |
|
Connoisseur
![]() Posts: 95
Karma: 10
Join Date: Jul 2023
Device: none
|
Here are some pictures that could be used.
Last edited by jwes; 01-10-2026 at 03:29 AM. Reason: pictures didn't show |
|
|
|
|
|
#7 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,208
Karma: 6565382
Join Date: Nov 2009
Device: many
|
You probably do not want single or double quotes inside a file name either. Starting a file name with a real alpha character instead of punctuation or a digit is also highly recommended.
So you should expand that regex to handle those replacements as well. |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Regex expression to replace certain spaces with nonbreaking spaces | Dashcroft | Sigil | 3 | 12-10-2022 09:01 PM |
| Converted book file names | 7cats | Conversion | 7 | 03-02-2018 03:32 AM |
| Check book 'omits' message about large file (File browser) | chaot | Editor | 1 | 06-02-2016 02:33 PM |
| How can I remove spaces from folder and file names? | jusmee | Calibre | 1 | 11-06-2009 11:36 PM |
| Mobi2mobi -spaces in file names | jflatto | Kindle Formats | 4 | 09-26-2008 12:38 AM |