Dynamic Renamer

EDIT: Nevermind, it really was a dumb question - RTFM. This worked to prepend a date in YYMMDD format:
-D/%y%m%d /

Thanks for this by the way, it's brilliant.


Dumb question, where do I go to change the date format used by the -d and -D operations?
I'm chasing a YYMMDD format.

On that note, is it possible to specify which template will be used with the -d or -D transformation if you have more than one template?

Cheers,

Kris

Version 1.11 adds a couple new capabilities (see the notes in this thread's second post).

The -dd transformation tries to detect a date within a filename and format it according to either the default specification or your own format supplied to the -dd transformation. The default output template is YYYY-MM-DD.


If you wanted year-only output, you'd use:

-dd/%Y/

The detection is based on some pre-defined patterns at the top of the Dynamic Renamer code. These can be supplemented or amended as necessary. Not all dates can be easily detected (e.g. Sept 09), due to language and parsing ambiguities, but it tries to detect common cases. You may be able to use the -d transformation for some of these ambiguous cases.

In the version 1.11 update, I'd forgotten from my notes to update a usage message for the -r (replace) transformation. I've posted the correction in the first post above, and it will be available in the next update. It reads:

-r  replace; format: -r/oldstr/newstr/gie  optional: g=global, i=ignore case, e=evaluate newstr as perl code

The replace transformation accepts three optional flags at the end of the command which modify the default behavior as mentioned.

[quote="MrC"]
Note: Version 1.11 requires a module update in ActivePerl. After installing ActivePerl, open a Windows command shell, and enter the command:

   ppm update date-manip

and hit Enter. When the update is complete, you can exit out of the command shell.[/quote]


MrC - this update fails as shown on my W7-64 system and consequently v1.11 does not work.
v1.10 is OK with the same version of ActivePerl - ActivePerl-5.16.3.1604-MSWin32-x64-298023.
I tried uninstalling and reinstalling ActivePerl. Same outcome.
Any suggestions?

Regards, AB

See if:

ppm install date-manip

works.

You can run ppm with no arguments, and it will launch the GUI. Then, you can type date-manip into the search box; it should list version 6.46, which you can select to install if the command above for some reason didn't work (though, I'm not sure why it wouldn't).

In case anyone else falls foul of this, there were two problems..

[ol][li]I had installed ActivePerl to C:\Program Files\Perl64 (which is R/O) instead of the default C:\Perl64[/li][li]The date-manip package was not installed and so could not be updated[/li][/ol]
I uninstalled ActivePerl and reinstalled to the default location. That solved the R/O problem. I then used the PPM GUI to install date-manip and all is now well with v1.11.

Regards, AB

Thanks for this MrC!

I initially tried with Active Perl 5.18.2.1802 x64, but this caused Opus to crash when the rename preview was enabled (Jon and Leo informed). When I uninstalled Active Perl 5.18.2.1802 x64 and installed 5.16.3.1604 x64, the crash disappeared.

I had same problem as aussieboykie in that date-manip was not installed, and had to run ppm install date-manip, so you might want to mention this in the first post MrC. One other suggestion to help beginners, would be to explain that they need to import the .orp file using the rename dialog File menu, and then to create/save a preset (eg. named "_Dynamic Renamer 1.11")

You're welcome, and thank you for the feedback. When I first posted Dynamic Renamer, 5.16 was the latest version.

I've updated the main post.

By the way, there's a new pre-release of 1.12 here: Rename Month Name to Month Integer if you want it.

The first post still mentions ppm update date-manip instead of ppm install date-manip

I'll check out 1.12pr

I was trying to use the -+1 transformation on file of the form filename_001.ext but it removes the leading zeros so ends up changing it to filename_2.ext instead of filename_002.ext. Would be great if it kept leading zeros.

To workaround the issue, I tried to chain the -### transformation but couldn't get the required result.

Also, the script doesn't remove any leading spaces from the New name field, so it doesn't recognise " -+1".

Ah, good ones. Thanks.

Here's another pre-release which fixes the two problems mentioned.
_Dynamic Renamer 1.12pre2.zip (6.31 KB)

Confirmed 1.12pre2 solves both issues.

Thanks for the quick fixes MrC.

@MrC

tip..

"... The script requires ActivePerl 5.16 (not 5.18)"

The link in your post gets you to the download site showing 5.18 and 5.20 only.
v5.16 is available in Business Edition and Enterprise Edition but I am not sure they are for free.

=

@opw62,

I've known about this for a while, and was awaiting for someone to mention it, or be affected by it. Unfortunately, ActivePerl pulled the old release, and has bumped their versions. They do charge for the archived versions (a pure money grab), so I'll have to check that the required modules are built for the newer versions of Perl (when I wrote Dynamic Renamer, they were not yet ready). I'll take a look this weekend.

Edit: The modules are available. I just have to verify the code is 5.18 or 5.20 compatible.

@MrC


I have a couple of older versions. Let me know if you need.

Regards, AB

@MrC -

So, the latest version of Dynamic Renamer is indeed compatible with v5.18.4.1803 / v5.20.1.2000 ?

If that is the case, then the below can be ignored...

==
As for v5.16.xxx

I am not sure whether the below files are 'reworked' (meaning: added trojans, malware, pups whatever)
but.. for x64 one might try it from CNet - ActiveState ActivePerl Windows (64-bit)
download.cnet.com/ActiveState-Ac ... =pdl-redir
File: ActivePerl-5.16.3.1603-MSWin32-x64-296746.msi - size: 27,6 MB (28.955.364 bytes)
Checksums:
CRC32: 2CE6DDE3
MD5 : 23103D237A9EE0E1836AF266603B9D01
SHA-1: 7A2BFE37BF17B227FDDEBB0A1D070A020C6E6704
SHA-256 : 9D8AE2B5FCE8B2D750B37CD238D5E6AF9DCE2C69E8571952A4ACB2D857B824BF

(cnet does not have the 32b version)

or
github.com/EQEmu/eqemu.github.c ... /downloads
ActivePerl-5.16.3.1604-MSWin32-x64-298023.msi - size: 27,6 MB (29.025.564 bytes)
CRC32 : 99ADAC59
MD5 : 376928383125FCA012FC359C38317028
SHA-1 : D3E16317B9DE6F18017C3BF79284E84A0F280EE0
SHA-256 : DD592518BC0A435E239CA447FB0B53061E32F1CAEB3602610ECC6449151DD1EA

ActivePerl-5.16.3.1604-MSWin32-x86-298023.msi - size: 25,7 MB (27.028.100 bytes)
CRC32 : 58D45C00
MD5 : 287C784C1791637EAE254E46EFBA6BB1
SHA-1: A8DCB719B0CF7CF08B0A3562BD0E81D05AB24F03
SHA-256: 3768D99A130FBF0070C70F0D31AD50AEFFD64AD9ED00C247FC9FFC2C0A6A9706

Now, I don't know which versions you have available at yours. Maybe you can verify the checksums?

Alternatively, maybe.. there is a download-location on the forum somewhere where you can store 'your'
ActivePerl? But likely that requires okay from the administrator. Just a suggestion.

[quote="opw62"]@MrC -

So, the latest version of Dynamic Renamer is indeed compatible with v5.18.4.1803 / v5.20.1.2000 ?

[/quote]

Well, so far, it isn't looking too good.

The 64-bit version of ActivePerl 5.20 causes DirectoryOpus 11.12.04 to crash upon selecting a perlscript rename script.

The 32-bit version of ActivePerl 5.20 causes DirectoryOpus to emit to the log the diagnostic "Script Engine 'perlscript' could not be opened".

Given the unfriendliness here towards anything not JScript or VBScript, I'm not hopeful this will get investigated or resolved.

Version 5.18 does not have certain required modules available, so that's a no-go.

Reinstalling 5.16 works fine, so I'd say the only option currently is that version.

I'm not going to post the binaries as this might violate some ActiveState terms. The 64-bit version of 5.16.3 you reference at CNet is identical to the one I have, which came from ActiveState's site. I'll update the links in post #1 to refer to those links - thanks for finding them.

It's crashing in PerlSE.dll in the call to IActiveScriptParse::InitNew. You'll have to report this to ActiveState if you want it "investigated or resolved" :slight_smile:

@Jon - Thanks, I'll report the issue.

@opw62 - I've updated the links in post #1.

From the ActivePerl developers:

... it looks like we already have a fix. It will be in the next release (5.20.2.2001), which seems likely to be released before the end of the month.