Multirename tool: start counter from the beginning when parent folder changes

English support forum

Moderators: sheep, Hacker, Stefan2, white

Post Reply
miskox
Junior Member
Junior Member
Posts: 99
Joined: 2003-06-11, 06:00 UTC

Multirename tool: start counter from the beginning when parent folder changes

Post by miskox »

Hello all!

Is is possible to have a counter [C] start from the beginning when parent folder changes?

Let's say we have this folder structure:

Code: Select all

\20190101\a.a
          b.b
          c.c
          d.d
\20190102\a.a
          b.b
          c.c
          d.d
          e.e
\20190103\a.a
          b.b
          c.c
          d.d
....
We press CTRL-B to see all the files, select them all, CTRL+M to start Multirename tool.

Now I want to rename the existing files to [P]-[C] but I want the counter to start from 1 (or preset with [C]) each time a parent folder [P] changes. So first folder would have filenames:

Code: Select all

\20190101\20190101-1.a
          20190101-2.b
          20190101-3.c
          20190101-4.d
\20190102\20190102-1.a
          20190102-2.b
          20190102-3.c
          20190102-4.d
          20190102-5.e
\20190103\20190103-1.a
          20190103-2.b
          20190103-3.c
          20190103-4.d
...
Another great thing would be to combine [G] and [P] in this way that we could select which parent folder to use. For example:

[P] would select parent folder
[1P] would select parent's folder parent folder (same as [G] currently - and [G] support would be removed).
[2P] would select one folder above....

and maybe [C] would support this:
[1C] would start from 1 (or [1C2] would start from 2 each time parent folder changes (also [2C]... for two folders above...).

(or other syntax because [1P] works at the moment... though I cannot find this in help.).

Saso
#224551

User avatar
dindog
Senior Member
Senior Member
Posts: 271
Joined: 2010-10-18, 07:41 UTC

Re: Multirename tool: start counter from the beginning when parent folder changes

Post by dindog »

our discussion group had some people asking is this possible a while ago.
support++

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 38773
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Multirename tool: start counter from the beginning when parent folder changes

Post by ghisler(Author) »

No, this is not possible. Why? It would mean that ALL target names in the preview need to be determined each time you change anything in the rename settings. With the currently available options, only the VISIBLE names need to be determined because no name depends on any previous name!

Imagine that there are 100'000 files to rename. Now if we use a plugin which needs 0.001 seconds to return a value, it would take only 0.02 seconds to update the preview for 20 displayed files. But in your case, to show the end of the list, TC would have to determine the new name for all 100'000 files aboce this location. This would take 100 seconds or 1 minute 40 seconds each time you change a single character! It would be even worse with slower plugins.
Author of Total Commander
http://www.ghisler.com

miskox
Junior Member
Junior Member
Posts: 99
Joined: 2003-06-11, 06:00 UTC

Re: Multirename tool: start counter from the beginning when parent folder changes

Post by miskox »

@ghisler: thank you for the answer.

Saso
#224551

User avatar
DrShark
Power Member
Power Member
Posts: 1474
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262

Re: Multirename tool: start counter from the beginning when parent folder changes

Post by DrShark »

ghisler(Author) wrote:
2019-12-29, 09:03 UTC
This would take 100 seconds or 1 minute 40 seconds each time you change a single character!
Maybe adding a switch for live/on demand preview could be a solution for such MRT tasks? So some time-consuming placeholders would work only after applying on demand preview.
Android 4.3.1 no root, kernel 08.09.2016; Vista Home Premium SP2 rus 32 bit
TC #149847 Personal licence

Cuz we're all in this together, We're here to make it right

User avatar
dindog
Senior Member
Senior Member
Posts: 271
Joined: 2010-10-18, 07:41 UTC

Re: Multirename tool: start counter from the beginning when parent folder changes

Post by dindog »

DrShark wrote:
2019-12-30, 11:42 UTC
ghisler(Author) wrote:
2019-12-29, 09:03 UTC
This would take 100 seconds or 1 minute 40 seconds each time you change a single character!
Maybe adding a switch for live/on demand preview could be a solution for such MRT tasks? So some time-consuming placeholders would work only after applying on demand preview.
and I think machine's time is not something I would rather save if I really need it...

If I have many folder need that order, I can choose brutal time consuming way, leaving the machine does its job, I just have a cup of tea than go to sleep... It's a diaster, on the other hand, software don't want to do it, I will have to do it by human's force....

User avatar
dindog
Senior Member
Senior Member
Posts: 271
Joined: 2010-10-18, 07:41 UTC

Re: Multirename tool: start counter from the beginning when parent folder changes

Post by dindog »

ghisler(Author) wrote:
2019-12-29, 09:03 UTC
No, this is not possible. Why? It would mean that ALL target names in the preview need to be determined each time you change anything in the rename settings. With the currently available options, only the VISIBLE names need to be determined because no name depends on any previous name!
So it won't happen if TC just implements the start new counter in differnt subfolder, right? Says, a [CP] start the counter index for every sub directories:
selecting:
foo\*
bar\*
zoo\*

Rename rule:
[CP].jpg

Result:
foo\01.jpg
foo\02.jpg
foo\03.jpg
...
bar\01.jpg
bar\02.jpg
bar\03.jpg
...
zoo\01.jpg
zoo\02.jpg
...

hi5
Member
Member
Posts: 187
Joined: 2012-11-03, 11:35 UTC
Contact:

Re: Multirename tool: start counter from the beginning when parent folder changes

Post by hi5 »

Perhaps too much work but perhaps possible: why not use the same approach as lister, you don't load a 5Gb file in lister but you can still view it as it only shows a part of the file in the lister window (if I understand it correctly) - why not have a similar "update visible listview rows only" approach for the MRT?

That probably means TC has to "find" the new name on the fly vs having an already prepared list before starting the rename process but if it is a separate mode (checkbox?) or configuration option I don't see why that couldn't work.

Nobody in their right mind is going to manually scroll 100.000 files to check out the new names :-)
F4MiniMenu - Open selected file(s) from TC in defined editor(s) - A (minimalistic) clone of F4Menu
Source at GitHub (AutoHotkey) - TC Forum thread

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 38773
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Multirename tool: start counter from the beginning when parent folder changes

Post by ghisler(Author) »

why not use the same approach as lister
I already do this now, that's EXACTLY the problem! Once the name depends on previous names, this approach isn't possible any more.
That probably means TC has to "find" the new name on the fly
That's not possible because you can specify the target directory when renaming, e.g.
newdir\[N]

"newdir" can be anything, even something taken from a plugin.
Author of Total Commander
http://www.ghisler.com

Post Reply