Page 2 of 2

Re: Renaming file(s) to modification date

Posted: 23 Oct 2008 15:33
by TheQwerty
admin wrote:
TheQwerty wrote:
admin wrote:I expected this one to work:

Code: Select all

rename , "*.<date yymmdd> /e";
but it just replaces the extension. I'd say this is a bug. If the /e switch is present, then * should refer to the whole name (base+extension), right?
I'd agree with that.
I'm not that sure anymore. It's a bit confusing:

Code: Select all

        Old     Pattern         New 
This is how it works now:
        a.jpg   *-<#3>          a-3.jpg
        a.jpg   *-<#3>.png      a-3.png.jpg
        a.jpg   *-<#3> /e       a-3
        a.jpg   *-<#3>.png /e   a-3.png

With the new way, the latter two would change as follows:
        a.jpg   *-<#3> /e       a.jpg-3
        a.jpg   *-<#3>.png /e   a.jpg-3.png
Now what's better?
*shrugs* To be honest I don't really use batch renaming, but after actually reading the help file's description of the switch "The /e switch simply means: drop the original extension," leaves me thinking you should just leave it as is. I think the majority of people are going to want the current behavior even if it is a little confusing. The case presented here is out of the ordinary I'd say, and as such it's acceptable if it cannot be done using only batch rename.


As an aside, I think you should add mention of the /s and /i switches to the Batch Rename dialog.

Re: Renaming file(s) to modification date

Posted: 23 Oct 2008 16:25
by jacky
admin wrote:I'd say this is a bug. If the /e switch is present, then * should refer to the whole name (base+extension), right?
Yeah, I eventually agree with TheQwerty, I think you shouldn't change it. It actually makes more sense to leave it to the base only, /e or not

Re: Renaming file(s) to modification date

Posted: 23 Oct 2008 17:13
by Muroph
you could use a different char to represent the extension when /e is used.
something like this

Code: Select all

        a.jpg   *-<#3> /e         a-3
        a.jpg   *-<#3>.png /e     a-3.png
        a.jpg   *-<#3>.? /e       a-3.jpg
        a.jpg   *-<#3>.?.png /e   a-3.jpg.png

Re: Renaming file(s) to modification date

Posted: 23 Oct 2008 17:37
by admin
Muroph wrote:you could use a different char to represent the extension when /e is used.
something like this

Code: Select all

        a.jpg   *-<#3> /e         a-3
        a.jpg   *-<#3>.png /e     a-3.png
        a.jpg   *-<#3>.? /e       a-3.jpg
        a.jpg   *-<#3>.?.png /e   a-3.jpg.png
Cool idea!

Re: Renaming file(s) to modification date

Posted: 25 Oct 2008 09:03
by Steadyhands
so does that mean that this should work now?

Code: Select all

rename b, "*.?.<date yymmdd>" /e
didn't work for me in a script.

but

Code: Select all

*.?.<date yymmdd> /e
works from the batch rename command line.

Re: Renaming file(s) to modification date

Posted: 25 Oct 2008 09:24
by admin
Steadyhands wrote:so does that mean that this should work now?

Code: Select all

rename b, "*.?.<date yymmdd>" /e
didn't work for me in a script.

but

Code: Select all

*.?.<date yymmdd> /e
works from the batch rename command line.
Switch /e goes inside the quotes; it's part of the pattern:

Code: Select all

rename "b", "*.?.<date yymmdd> /e";