Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 01-14-2021, 02:40 PM   #1
thiago.eec
Guru
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 935
Karma: 1177583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Bulk renaming files

Hi Kovid,

When renaming multiple files on the Editor, it throws an error if some of the files has the same name as before. Can't calibre just ignore this?

Example:

Original:
Code:
file001.html
file003.html
file003a.html
file004.html
file008.hmtl
After renaming:
Code:
file001.html
file002.html
file003.html
file004.html
file005.hmtl
The 4th file has the same name before and after, which causes calibre not renaming any file.
thiago.eec is offline   Reply With Quote
Old 01-14-2021, 03:28 PM   #2
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,654
Karma: 145557716
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by thiago.eec View Post
Hi Kovid,

When renaming multiple files on the Editor, it throws an error if some of the files has the same name as before. Can't calibre just ignore this?

Example:

Original:
Code:
file001.html
file003.html
file003a.html
file004.html
file008.hmtl
After renaming:
Code:
file001.html
file002.html
file003.html
file004.html
file005.hmtl
The 4th file has the same name before and after, which causes calibre not renaming any file.
I tend to do a bulk rename in two steps. Using your file names, I would rename them to refilexxx.html and then to filexxx.html. This avoids the probability of ending up with files named out of order.
Code:
file001.html
file002.html
file004.html
file003.html
file005.html
file006.hmtl
DNSB is online now   Reply With Quote
Advert
Old 01-14-2021, 10:50 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,892
Karma: 22666668
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Because it doesnt know ifthe name conflict is ok or accidental.
kovidgoyal is offline   Reply With Quote
Old 01-15-2021, 09:55 AM   #4
thiago.eec
Guru
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 935
Karma: 1177583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by DNSB View Post
I tend to do a bulk rename in two steps. Using your file names, I would rename them to refilexxx.html and then to filexxx.html. This avoids the probability of ending up with files named out of order.
I also have to use a two steps process. For me, this is really unnecessary.

Quote:
Originally Posted by kovidgoyal View Post
Because it doesnt know ifthe name conflict is ok or accidental.
Well, let's think about the process:

1) User selects all the files he wants renamed
2) Then, the user explicitly tell the Editor to rename then (right-clicking and choosing this option)
3) A window pops-up and he choose the prefix and starting number
4) Only then the renaming occurs

Is this possible to happen accidentally? I wonder how the user could not mean all the files to be renamed.

Maybe, a confirmation dialog could be added in case of identical names appearing.

Last edited by thiago.eec; 01-15-2021 at 07:59 PM.
thiago.eec is offline   Reply With Quote
Old 01-15-2021, 01:31 PM   #5
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,654
Karma: 145557716
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by thiago.eec View Post
I also have to use a two steps process. For me, this is really unnecessary.
To you it may be unnecessary. To the operating system, having two files with the same name in the same directory is going to be an issue so renaming a file to the name of an existing file in the same directory is not going to fly.
DNSB is online now   Reply With Quote
Advert
Old 01-15-2021, 08:07 PM   #6
thiago.eec
Guru
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 935
Karma: 1177583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by DNSB View Post
To you it may be unnecessary. To the operating system, having two files with the same name in the same directory is going to be an issue so renaming a file to the name of an existing file in the same directory is not going to fly.
About the existence of another file with the same name in the same directory, you are absolutely right. The code I proposed would not work, because of that.

Now, about the original question, I think you've got me wrong. What I was suggesting is that calibre could handle this, instead of the user having to do it manually, renaming twice. As I said on my last reply, I don't think the user would rename it accidentally, so calibre could aloud it.
thiago.eec is offline   Reply With Quote
Old 01-15-2021, 08:21 PM   #7
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 516
Karma: 32106
Join Date: Feb 2012
Device: Onyx Boox Leaf
I think it can't be done accidentally. Even if it is the case, it can be undone easily.
nqk is offline   Reply With Quote
Old 01-15-2021, 09:03 PM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,892
Karma: 22666668
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The renaming doesnt happen accidentally, obviously. The *name conflict* could happen accidentally, i.e. the user may not realize that his or her new naming scheme is conflicting with existing file names.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Renaming files victormpalma Library Management 1 07-14-2020 09:55 AM
Bulk renaming of titles? jukin Calibre 3 04-24-2013 11:04 PM
Bulk Renaming OklahomaMike Library Management 1 01-20-2013 10:21 PM
Renaming files in bulk ElMiko Sigil 12 02-15-2012 10:38 AM
Renaming files col Sony Reader 29 06-29-2007 10:10 AM


All times are GMT -4. The time now is 08:18 PM.


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