Page 2 of 2

Posted: 08 Apr 2008 10:50
by ivan
Here are the screenshots to illustrate:

Before rename (of the top RAR file):

http://i32.tinypic.com/2zznwjl.jpg

After rename (of the top RAR file):

http://i26.tinypic.com/p3q5e.jpg

Hope it helps ;)

Posted: 08 Apr 2008 11:18
by jacky
Oh, right, yes in your case it adds a suffix number, and I think it is because there is already a file with the same name : the very file you're renaming !!

In Windows, files "foobar", "FooBar" and "FOOBAR" are the same, even though you can rename it to change the case.

So the problem here is that XY sees a duplicates with itself (file that is being renamed) while it shouldn't, obviously. Happens when you try to rename a file "readme.txt" to "ReadMe.txt" using Batch Rename as well.

And that indeed would actually be a little bug I believe!

----

Unrelated sidenote regarding what's been said before: Another nice thing would be the support of multi-line scripts in Catalog ! Right now I have to either use a single-line script, but it's not that fun to work on it, or use a file but for often used scripts, I'm assuming that means a lot of disk access to read the script file every time, which might not be so good...

Posted: 08 Apr 2008 11:21
by ivan
I'm no longer XYplorer bug virgin! :lol:

Hope to hear admin's thoughts on this about fixing perhaps? Cheers in advance 8)

Posted: 08 Apr 2008 11:28
by jacky
PS: While waiting for the bugfix which will, I'm sure, be there soon, you can use this instead on your script, should work just fine (as long as the file you rename as an extension) :

Code: Select all

 rename re, "^(.*)\.(.*)$>$name.$2";

Posted: 08 Apr 2008 11:47
by ivan
jacky wrote:PS: While waiting for the bugfix which will, I'm sure, be there soon, you can use this instead on your script, should work just fine (as long as the file you rename as an extension) :

Code: Select all

 rename re, "^(.*)\.(.*)$>$name.$2";
How would I integrate it into my existing script?

Posted: 08 Apr 2008 12:01
by jacky
Here, there you go, this should work as expected :

Code: Select all

regexreplace $name, <curitem>, "^.+\\([^\\]+?)\\[^\\]+?.*$", "$1";
 rename re, "^(.*)\.(.*)$>$name.$2";

Posted: 08 Apr 2008 12:06
by ivan
Yes, works perfectly! Thanks a bunch. It's still a little bug though :wink:

Posted: 08 Apr 2008 14:01
by admin
ivan wrote:Yes, works perfectly! Thanks a bunch. It's still a little bug though :wink:
Yep, just fixed it. Good little find. :)