[7.56a] MRT: replacing mutiple strings using wildcards

Bug reports will be moved here when the described bug has been fixed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
white
Power Member
Power Member
Posts: 5788
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

[7.56a] MRT: replacing mutiple strings using wildcards

Post by *white »

In the Multi-rename tool when using search+replace multiple strings in one step using the pipe symbol (no regex!), wildcard matching in the replace field goes wrong.

It seems wildcard matching is only done when searching for the first string, but the wildcard use of the first string is maintained for the second string.

Examples:

Make a file named "filename".
Select the file and press Ctrl+M (Multi-rename tool).

Example 1 (wildcard use of first string is also used for second string)

Code: Select all

File name:        filename

Search for:       file|name
Replace with:     ?-?-|----

Result:           f-l-n-m-
Result should be: f-l-----
Example 2 (wildcard in second replace string is not processed)

Code: Select all

File name:        filename

Search for:       file|name
Replace with:     ----|?-?-

Result:           ----?-?-
Result should be: ----n-m-
Example 3 (correct, included to show what happens)

Code: Select all

File name:        filename

Search for:       file
Replace with:     -*

Result:           -ilenamename
Example 4 (correct, included to show what happens)

Code: Select all

File name:        filename

Search for:       file|name
Replace with:     -*|-

Result:           -ile--
Example 5 (wildcard use of first string is also used for second string)

Code: Select all

File name:        filename

Search for:       file|name
Replace with:     -*|--

Result:           -ile-amename-ame
Result should be: -ile----
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: [7.56a] MRT: replacing mutiple strings using wildcards

Post by *Hacker »

white,
white wrote:Example 5 (wildcard use of first string is also used for second string)

Code: Select all

File name:        filename

Search for:       file|name
Replace with:     -*|--

Result:           -ile-amename-ame
Result should be: -ile----
Small note - should result not be:
-ile--
instead? (Without the last two --)

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
white
Power Member
Power Member
Posts: 5788
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [7.56a] MRT: replacing mutiple strings using wildcards

Post by *white »

Hacker wrote:Small note - should result not be:
-ile--
instead? (Without the last two --)
No. As you can see in example 3 (and 4), the string "name" matches two times.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Wildcards are not supported together with the | option, so the result will be completely random. I will check whether I can support wildcards.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5788
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:I will check whether I can support wildcards.
Thanks.
User avatar
white
Power Member
Power Member
Posts: 5788
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Tested OK using TC 8.0b3 (32bit).
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks!
Author of Total Commander
https://www.ghisler.com
Post Reply