Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 11-29-2020, 05:32 PM   #1
mfaine1
Member
mfaine1 began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Oct 2020
Device: Kindle
Don't replace dot with underscore in folder name

I've searched here and seen a few posts about this but nothing that resolves the issue. On Linux, a folder name like "Rowling, J. K." is completely legal so there is no reason to replace the final dot with an underscore, is there some way I can turn this off or override it?

I think I figured this out years ago but I don't remember the solution.

Thanks
mfaine1 is offline   Reply With Quote
Old 11-29-2020, 08:02 PM   #2
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: 26,014
Karma: 39102633
Join Date: Aug 2009
Location: The Central Coast of California
Device: K4NT(Fixed,New Bat.), Galaxy Tab A, Kobo Aura2
Ill Eagle = Sick bird

Calibre makes file names that are VALID cross (all 3) platform.
So it may be valid for Linux, but it is not for Win
theducks is offline   Reply With Quote
Advert
Old 11-29-2020, 08:03 PM   #3
mfaine1
Member
mfaine1 began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Oct 2020
Device: Kindle
I understand but this book will never see Windows operating system, so is there some way to override it?
mfaine1 is offline   Reply With Quote
Old 11-29-2020, 09:08 PM   #4
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: 26,014
Karma: 39102633
Join Date: Aug 2009
Location: The Central Coast of California
Device: K4NT(Fixed,New Bat.), Galaxy Tab A, Kobo Aura2
Quote:
Originally Posted by mfaine1 View Post
I understand but this book will never see Windows operating system, so is there some way to override it?
NO , Calibre has its goals and that would bust one
theducks is offline   Reply With Quote
Old 11-29-2020, 09:12 PM   #5
mfaine1
Member
mfaine1 began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Oct 2020
Device: Kindle
Is this Kovid's answer or just your opinion? I mean if I have to I'll write a plugin to do it myself but I hope I don't have to go that far.
mfaine1 is offline   Reply With Quote
Advert
Old 11-29-2020, 09:14 PM   #6
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: 26,014
Karma: 39102633
Join Date: Aug 2009
Location: The Central Coast of California
Device: K4NT(Fixed,New Bat.), Galaxy Tab A, Kobo Aura2
Quote:
Originally Posted by mfaine1 View Post
Is this Kovid's answer or just your opinion? I mean if I have to I'll write a plugin to do it myself but I hope I don't have to go that far.
My Answer from hanging around here for a Decade and reading Kovids replies
theducks is offline   Reply With Quote
Old 11-29-2020, 09:44 PM   #7
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 11,210
Karma: 61896319
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Just to be clear; is your question referring to the copy of the book stored within the calibre library? If so check out the sticky threads in this subforun
PeterT is offline   Reply With Quote
Old 11-29-2020, 10:10 PM   #8
mfaine1
Member
mfaine1 began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Oct 2020
Device: Kindle
Yes, the copy of the book in the library. I didn't see anything specific but I'll keep looking. I did see this but I'm not really wanting to change the folder structure. Best I can tell there is no linkage to the filesystem in the database, maybe I'm wrong and I'll find out if I am. That's why you make backups


For anyone that comes to this after me, for now the easiest fix that I know is to create a shell script and run it with cron or as-needed. With the rename command this is trivial.

apt-get install rename

fix-ebook-filenames.sh:

#!/bin/bash
# Calibre won't write the directory names properly, this will correct the directory names

dir="$1"
shift

if [[ "$#" -ne 1 ]]; then
echo "A directory is required"
exit 1
fi

if [[ -d "$dir" ]]; then
cd "$dir" || exit 1
rename "$@" 's/_/\./' ./*
fi

--

Then you can run it with /path/to/fix-ebook-filenames.sh /path/to/library
Any additional command line options go to the rename command.
mfaine1 is offline   Reply With Quote
Old 11-29-2020, 11:42 PM   #9
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 11,210
Karma: 61896319
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
But doing that will break calibre. The standard advice is to treat the entire file structure that is the calibre library as a black box to be left alone.

If you want content in the format / structure that YOU want do a "Save to disc" and use a template that YOU select.
PeterT is offline   Reply With Quote
Old 11-29-2020, 11:48 PM   #10
mfaine1
Member
mfaine1 began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Oct 2020
Device: Kindle
You're right, it does seem like there are some references in the database. I can probably just do the modifications to the database in a python script. I hear what you're saying but it's not ever going to be a black box to me.
mfaine1 is offline   Reply With Quote
Old 11-30-2020, 12:55 AM   #11
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: 11,407
Karma: 53498385
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Forma, Clara HD, Nexus 7 HD, iPad Pro, Tolino epos
Quote:
Originally Posted by mfaine1 View Post
You're right, it does seem like there are some references in the database. I can probably just do the modifications to the database in a python script. I hear what you're saying but it's not ever going to be a black box to me.
You can do what you want but please don't complain or ask for help when you turn your library into a bit bucket.
DNSB is online now   Reply With Quote
Old 11-30-2020, 04:18 AM   #12
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 66,656
Karma: 285999999
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Quote:
Originally Posted by mfaine1 View Post
I've searched here and seen a few posts about this but nothing that resolves the issue. On Linux, a folder name like "Rowling, J. K." is completely legal so there is no reason to replace the final dot with an underscore, is there some way I can turn this off or override it?
You need to ask yourself why you're concerned about this.

Any use of the file outside the calibre library should be by transferring it to a device or by exporting. For both those cases you can affect the formatting of the folder and file names.

Why are you concerned with the name of the folder inside the calibre library?
pdurrant is offline   Reply With Quote
Old 11-30-2020, 05:09 AM   #13
BetterRed
null operator
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: 16,982
Karma: 19749604
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@mfaine1 - the folder and file names within the library are arbitrary

Another developer might have taken an obscurantist approach by using the database author and book table row numbers to name library folders and files. Instead the developer of calibre chose to implement a solution based on author names and book titles that are acceptable to the various platforms that calibre supports (operating + file system), and be comprehensible to us mere mortals.

BR
BetterRed is offline   Reply With Quote
Old 11-30-2020, 10:46 AM   #14
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: 26,014
Karma: 39102633
Join Date: Aug 2009
Location: The Central Coast of California
Device: K4NT(Fixed,New Bat.), Galaxy Tab A, Kobo Aura2
Quote:
Originally Posted by DNSB View Post
You can do what you want but please don't complain or ask for help when you turn your library into a bit bucket.
There's a hole in my bucket
and all my books fell out
theducks is offline   Reply With Quote
Old 11-30-2020, 11:52 AM   #15
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 61,840
Karma: 88645836
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, PRS-650, PRS-T1, nook STR, iPad 4, iPhone SE 2020, PW3
Quote:
Originally Posted by mfaine1 View Post
I can probably just do the modifications to the database in a python script.
No you can't do your modification to the database with a any script because if you do, you WILL BREAK your database. Do you want a broken database? That will make it harder to get those broken book out of Calibre and on your reading device.
JSWolf is offline   Reply With Quote
Reply

Tags
folder name, templates

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Editor - Global Search/Replace of underscore format Canoe Editor 1 07-11-2015 11:57 PM
Books in Calibre folder don't turn up in search montalex Library Management 16 04-20-2014 05:08 PM
Books in Calibre folder don't turn up in search montalex Library Management 5 01-08-2014 12:17 AM
Save to Disc - Folder name - Period changes to Underscore Gutenberg Library Management 4 09-17-2012 11:48 AM
K3:Don't see new photo folder I just added FF2 Amazon Kindle 3 10-24-2010 06:10 PM


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


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