Multi-rename tool bug

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
ymmv
Junior Member
Junior Member
Posts: 34
Joined: 2004-03-06, 12:22 UTC

Multi-rename tool bug

Post by *ymmv »

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.
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

Sorry, cannot confirm !
Examples work fine over here ... (TC 7.50a + WinXP)

5015182_My Darling Clementine (1946).mkv becomes 1946.mkv
5000625_Young Mr. Lincoln (1939).mkv becomes 1939.mkv
#5767 Personal license
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

Neither can I (W2kSP3Eng, TC 7.50 pb5)
Single user license #329241
PowerPro scripts for Total Commander
ymmv
Junior Member
Junior Member
Posts: 34
Joined: 2004-03-06, 12:22 UTC

Post by *ymmv »

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
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

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
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

:?: This makes no difference due to the fact, that renaming mask: [N-5,4] will rename the file, not the directory :?:

Additional I tried [P-5,4] to handle directory parent names accordingly, which works fine too.
#5767 Personal license
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

Oh well I see: You try to rename the directories only :idea:

Try [=tc.fullname:-5,4] instead ... using the Plugin button
#5767 Personal license
ymmv
Junior Member
Junior Member
Posts: 34
Joined: 2004-03-06, 12:22 UTC

Post by *ymmv »

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.
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.
ymmv
Junior Member
Junior Member
Posts: 34
Joined: 2004-03-06, 12:22 UTC

Post by *ymmv »

sqa_wizard wrote:Oh well I see: You try to rename the directories only :idea:

Try [=tc.fullname:-5,4] instead ... using the Plugin button
Thanks. That works if I also clear the extension field. So I've got a solution now.

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.
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

Regular expressions are only useful for search replace operations
Not at all. Please read the manual. It is true for "both search and replace"
Single user license #329241
PowerPro scripts for Total Commander
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

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.
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".
BTW, I don't see any bug, TC renames mentioned folders as expected.
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

Some weeks ago I've had the following problem (here is the link to the corresponding Russian forum thread):
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
The task is to remove the "character" part of the name, leaving its "numeric" part, that is, to get:

Code: Select all

0075.jpg
0078.jpg
0084.jpg
0526.jpg
367.jpg
2.jpg
4.jpg
Users are welcome to find the solution on their own, and then read solutions below.
Solutions are (not mine :():

Code: Select all

1:
Find:  (\D)+(\d+\..+)
Replace: $2

2:
Find: (\..+)|\D
Replace: $1

3:
Find: ^\D+
Replace: <Clear> 
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).
Single user license #329241
PowerPro scripts for Total Commander
Post Reply