![]() |
#1 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 143
Karma: 76596
Join Date: Feb 2015
Location: Portugal
Device: Kobo Aura HD
|
Characters forbidden or not recommended when saving to disk
Is there a list of characters that should not be used in the "save to disk" templates.
I know some are forbidden as : that will be converted into _ when saving a file to disk (export). Is there some list of forbidden or a list of "not recommended" characters? Example What if I want to use straight brackets [] as a separator in fields? Can this be a problem for some file system later? Code:
{author_sort:}{series:| [|}{series_index:||]}{title:| - |} Code:
Doe, John [Series-03] - Book Title.pdf Last edited by Horus68; 10-02-2019 at 12:51 PM. |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,057
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Square Bkts are used all the time
![]() Colon, Dollar, Ampersand, Star, Question mark and any Non-ASCII are either prohibited or best avoided. IMHO use _ instead of spaces as some file system want encoding and that messes with searches... |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 143
Karma: 76596
Join Date: Feb 2015
Location: Portugal
Device: Kobo Aura HD
|
Thanks for your suggestions!
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
As you have a Kobo device, the following is run over the filename after it is constructed:
Code:
invalid_filename_chars_re = re.compile(r'[\/\\\?%\*:;\|\"\'><\$!]', re.IGNORECASE | re.UNICODE) return [invalid_filename_chars_re.sub('_', x) for x in components] Code:
/ \ ? % * : ; | " ' > < $ ! |
![]() |
![]() |
![]() |
#5 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 143
Karma: 76596
Join Date: Feb 2015
Location: Portugal
Device: Kobo Aura HD
|
Thanks.
On the save to disk template dialog, I will also use the option "Replace spaces with underscore" so no spaces will be outputted to file names (as the values from the title field) The only issue is for the "Stripping out the escape characters" as a space is added between them. See related: https://www.mobileread.com/forums/sh...d.php?t=310144 Last edited by Horus68; 10-03-2019 at 09:28 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
|
I have the following template:
Code:
{#status}/{#fandoms:re(:, )}/{#story_id}/{#story_id} I would like to change one character to another as well as remove the :? + to something like & Can anyone help me? |
![]() |
![]() |
![]() |
#7 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Spaces are not an issue for Windows. No need for an underscore.
|
![]() |
![]() |
![]() |
#8 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,057
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
![]() |
![]() |
![]() |
#9 |
Enthusiast
![]() Posts: 34
Karma: 10
Join Date: Jun 2012
Device: Nook
|
and I have run into some programs on Micro$oft Windoze that do not properly save (save as works though) when trying to save a file you edit that is stored in a folder with [] in the folder name
|
![]() |
![]() |
![]() |
#10 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Caveat but they're not created, read or written by calibre. BR |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Saving to disk | svda | Library Management | 6 | 04-10-2015 07:42 PM |
Need a little help with saving to disk | svda | Conversion | 35 | 03-03-2014 03:08 PM |
Losing files when saving saving to disk | theaccountant | Library Management | 4 | 03-10-2011 02:38 PM |
Saving to disk | htaylor | Calibre | 2 | 01-04-2009 08:29 PM |