MultiRenameTool: Auto rename on filename collision need

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Post by *milo1012 »

MVV wrote:MRT setting dups may be predicted before starting overall rename operation (just like current TC checks for duplicates in resulting names and hints that something may be set wrong)
That's obvious. And this check should stay as it was, IMO.
But I meant duplicates resulting from TC's own rename procedure, where TC can't distinguish in advance that conflicts may arise.
Simple example: having files like
1.txt
2.txt
3.txt

and now trying to rename them in reverse order with [N]
Result: TC tries, but fails of course, due to a lack of "predicting" logic.
TC plugins: PCREsearch and RegXtract
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

All cases when TC can't predict duplicates are run-time ones IMO. Initial check is just a hint for the user but then conflicts should be resolved by standard auto-rename with appending (2), (3) etc if user allows that.
Result: TC tries, but fails of course, due to a lack of "predicting" logic.
Maybe I don't understand something but I can't reproduce it. What do you mean by reverse order? Even if I reorder files in MRT, TC silently renames files in case of [N] template.
User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Post by *milo1012 »

Sorry, typo. :x
I meant the [C] field of course.
Either sort files in descending order, mark them and start MRT,
or change order to descending in MRT (name column).

You now have

Code: Select all

old name        new name
3.txt                1.txt
2.txt                2.txt
1.txt                3.txt 
-> TC fails to rename
TC plugins: PCREsearch and RegXtract
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

You're right, TC can't predict dups in such case and begins renaming. I think it may be just another case of run-time dups. It seems that TC only checks for dups within resulting set of names (and it is enough IMO for such hint).
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Another solution would be a two pass approach, like when copying: First do the renaming, and remember which failed (already done). Then ask the user whether he wants to retry these, and append a number in case of duplicates.
Author of Total Commander
https://www.ghisler.com
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

ghisler(Author) wrote:Another solution would be a two pass approach, like when copying: First do the renaming, and remember which failed (already done). Then ask the user whether he wants to retry these, and append a number in case of duplicates.

That's also an possible solution.



---------------------------
Total Commander
---------------------------
Warnung, doppelte Namen! Trotzdem fortfahren?
---------------------------
[Ja] [Nein]
---------------------------


---------------------------
Total Commander
---------------------------
Fehler, konnte die fett dargestellten Dateien nicht umbenennen!
---------------------------
[Add auto suffix] [OK]
---------------------------


---------------------------
Total Commander
---------------------------
Fehler, eine Datei mit diesem Namen existiert bereits in diesem Verzeichnis!
Otto.TXT
---------------------------
[Add auto suffix] [OK]
---------------------------



 
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

MultiRenameTool: Auto rename on filename collision need

Post by *Stefan2 »

08.06.16 Release Total Commander 9.0 beta 1 (32/64)

22.01.16 Added:
Multi-rename tool: If there are duplicate names, or names that already exist,
offer to auto-rename to "name (2).ext", "name (3).ext" etc. (32/64)


Thanks for implementing, First test works fine.




 
Post Reply