MRT: reset counter on every folder.

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
xmeron
Junior Member
Junior Member
Posts: 90
Joined: 2009-06-17, 19:43 UTC

MRT: reset counter on every folder.

Post by *xmeron »

:arrow::arrow::arrow:
In TC's multi-rename, there is a counter tool, it's very useful, but when you expand many folders and then multi-rename:
==========
Before in TC you will get below effect:
Folder1: file1, file2, file3.
Folder2: file4, file5, file6, file7.
Folder3: file8, file9, file10.
=====
Now what I need is:
Folder1: file1, file2, file3.
Folder2: file1, file2, file3, file4.
Folder3: file1, file2, file3.
==========
it seems there is no a simple way to get this effect, so maybe we can add an option: Every folder has it's own counter.

##########
In addition, we can also add more powful functions, such as [Cr3,5,4]:
Cr is the abbreviation of Counter reset, and
the first 3 files will be counted as 1, 2, 3.
the second 5 files after just 3 files, will be counted as 1, 2, 3, 4, 5.
the third 4 files after just 5 files, will be counted as 1, 2, 3, 4.
......
and etc.

Or, maybe we can add a check box at the end of the new name in multi-rename preview window, if this line is checked, it shows that the counter will be reset to initial value from this line, and you can select multiple check boxes according to your requirement.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50873
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately this is currently impossible because it is a conditional option: To find out the name of the LAST file, TC would first need to determine the name of all files above it first. Currently each name can be determined independently.
Author of Total Commander
https://www.ghisler.com
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Option #1: CheckBox option to only apply the [C] counter in the "Rename Mask" if the "Search For" field matches. Which would allow something like:
Rename Mask: [P]__[N]__[C]
Search For: ^ExampleParentName__
Replace With: <blank>
When the search/replace MRT is run, the [C] counter would only be applied to files that match the Search string.


Option #2: Allow a [C] counter field in search/replace.
Rename Mask: [N]__[P]
Search For: __ExampleParentName\.
Replace With: ::[C].
Both would still require multiple passes of the MRT. Yet without overhauling the rename code, Option #1 or #2 should be a workable solution. Since in both cases TC would know the last file to be renamed.


[OT]
Of course overhauling the MRT wouldn't be such a horrible consideration. To allow for such things as MULTIPLE Search/Replace ala EmEditor's "batch" regexp Search/Replace. To do a simulcrum of a batch search/replace in TC requires a lot of manual input from the end user, and one must also remember which search replaces to apply and in which order.

Or you could use the "editor" option.
1) Open file list (from MRT) in Notepad.
2) Select All. Copy.
3) Paste in EmEditor.
4) Run the batch/replace that you saved previously.
5) Select All. Copy.
6) Paste into Notepad.
7) Save File.
8) Close Notepad.

Still likely less work than writing a one-off script to do so. Since batch/replaces can be saved in EmEditor, just like TC's single search/replaces can be saved.
User avatar
xmeron
Junior Member
Junior Member
Posts: 90
Joined: 2009-06-17, 19:43 UTC

Post by *xmeron »

2ghisler:
Thanks for your reply, it seems I have to go on to use external tool (e.g., Microsoft Excel) to edit and create NAME COUNTER manually 'one folder by one folder'.
User avatar
xmeron
Junior Member
Junior Member
Posts: 90
Joined: 2009-06-17, 19:43 UTC

Post by *xmeron »

2Balderstrom:
Your two options are still not easy enough to solve this problem, as you said, they both require multiple passes, but at least it has a valuable step to the future, thanks so much.
Post Reply