Multi-rename tool bug
Moderators: Hacker, petermad, Stefan2, white
Multi-rename tool bug
I've just noticed a problem with the multi-rename tool. I'm using the following mask [N-5,4] to extract the year from a filename. I noticed this happening:
GOOD: 5015182_My Darling Clementine (1946).mkv becomes 1946
WRONG: 5000625_Young Mr. Lincoln (1939).mkv becomes ng Mr. Lincoln (1939)
[N] gives you the full name without the extension, but that doesn't happen when you extract a part counting backwards because then you get the result starting from the first dot in the filename instead of the separator dot.
GOOD: 5015182_My Darling Clementine (1946).mkv becomes 1946
WRONG: 5000625_Young Mr. Lincoln (1939).mkv becomes ng Mr. Lincoln (1939)
[N] gives you the full name without the extension, but that doesn't happen when you extract a part counting backwards because then you get the result starting from the first dot in the filename instead of the separator dot.
- sqa_wizard
- Power Member
- Posts: 3893
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
- Vochomurka
- Power Member
- Posts: 816
- Joined: 2005-09-14, 22:19 UTC
- Location: Russia
- Contact:
Neither can I (W2kSP3Eng, TC 7.50 pb5)
Single user license #329241
PowerPro scripts for Total Commander
PowerPro scripts for Total Commander
Made a mistake. Disregard the whole bit about filenames since the bug happens only when directory names contain a dot.
So let's start again with this renaming mask: [N-5,4]
GOOD: Directory 5015182_My Darling Clementine (1946) becomes 1946
WRONG: Directory 5000625_Young Mr. Lincoln (1939) becomes ng Mr. Lincoln (1939)
Win7 64, TC 7.50a
So let's start again with this renaming mask: [N-5,4]
GOOD: Directory 5015182_My Darling Clementine (1946) becomes 1946
WRONG: Directory 5000625_Young Mr. Lincoln (1939) becomes ng Mr. Lincoln (1939)
Win7 64, TC 7.50a
- Vochomurka
- Power Member
- Posts: 816
- Joined: 2005-09-14, 22:19 UTC
- Location: Russia
- Contact:
I think that the file extension and directory extension are treated differently by the operating system. Fot file, ext is all characters after last dot, for directories it seems to be those after first dot. Try using regular expressions.
Single user license #329241
PowerPro scripts for Total Commander
PowerPro scripts for Total Commander
- sqa_wizard
- Power Member
- Posts: 3893
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
- sqa_wizard
- Power Member
- Posts: 3893
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
I can't really use regular expressions. The complete renaming mask is "[N-5-2] - [N9--8]" so I can change directory names like "5015182_My Darling Clementine (1946)" into "1946 - My Darling Clementine". I extract the year and put it in front. You can only do that with the rename mask. Regular expressions are only useful for search replace operations.Vochomurka wrote:I think that the file extension and directory extension are treated differently by the operating system. Fot file, ext is all characters after last dot, for directories it seems to be those after first dot. Try using regular expressions.
Thanks. That works if I also clear the extension field. So I've got a solution now.sqa_wizard wrote:Oh well I see: You try to rename the directories only![]()
Try [=tc.fullname:-5,4] instead ... using the Plugin button
In my view only filenames have seperator dots and extensions, directory names don't have extensions. Dots in directory names shouldn't be treated as seperators. But that's not the way TC works I see.
- Vochomurka
- Power Member
- Posts: 816
- Joined: 2005-09-14, 22:19 UTC
- Location: Russia
- Contact:
Not at all. Please read the manual. It is true for "both search and replace"Regular expressions are only useful for search replace operations
Single user license #329241
PowerPro scripts for Total Commander
PowerPro scripts for Total Commander
Usually extension is a part of name after last dot, regardless of object type. But any program may interpret extension in its own way. In this case I think that TC should split folder name "5000625_Young Mr. Lincoln (1939).mkv" to name "5000625_Young Mr. Lincoln (1939)" and extension "mkv".Vochomurka wrote:I think that the file extension and directory extension are treated differently by the operating system. Fot file, ext is all characters after last dot, for directories it seems to be those after first dot. Try using regular expressions.
BTW, I don't see any bug, TC renames mentioned folders as expected.
- Vochomurka
- Power Member
- Posts: 816
- Joined: 2005-09-14, 22:19 UTC
- Location: Russia
- Contact:
Some weeks ago I've had the following problem (here is the link to the corresponding Russian forum thread):
There are some files:The task is to remove the "character" part of the name, leaving its "numeric" part, that is, to get:Users are welcome to find the solution on their own, and then read solutions below.
Solutions are (not mine
):All these solutions work.
Unfortunately, I'm not experienced enough in RegEx. But anyone can find its own problem's solution (including that by ymmv) basing on above examples (especially the latter one, without replace).
There are some files:
Code: Select all
IMG_0075.jpg
IMG_0078.jpg
IMG_0084.jpg
IMG_0526.jpg
Image 367.jpg
Image v2.jpg
Image v4.jpg
Code: Select all
0075.jpg
0078.jpg
0084.jpg
0526.jpg
367.jpg
2.jpg
4.jpg
Solutions are (not mine

Code: Select all
1:
Find: (\D)+(\d+\..+)
Replace: $2
2:
Find: (\..+)|\D
Replace: $1
3:
Find: ^\D+
Replace: <Clear>
Unfortunately, I'm not experienced enough in RegEx. But anyone can find its own problem's solution (including that by ymmv) basing on above examples (especially the latter one, without replace).
Single user license #329241
PowerPro scripts for Total Commander
PowerPro scripts for Total Commander