Bug: Regular expressions & Multi-rename tool

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
leedlt
Junior Member
Junior Member
Posts: 18
Joined: 2004-05-03, 08:51 UTC
Location: Stuttgart, Germany

Bug: Regular expressions & Multi-rename tool

Post by *leedlt »

Hi Folks,

I'm trying to rename a number of files using the Mult-rename tool. Here's short list of the files (the format of the digits is dd.mm.yyyy and I'd like to have yyyy.mm.dd):
10.06.2004_Test.data
10.09.2004_Test.data
11.06.2004_Test.data
11.10.2004_Test.data

The "Rename mask: file name" and "Extention" fields are empty.
"Search for:" is "(\d{2})\.(\d{2})\.(\d{4})(.*)" and
"Replace with:" is $3.$2.$1$4

When I click Start I get the message: "Error, could not rename the files shown in bold"

Is this a bug or am I doing something wrong?

Thom
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

2leedlt
Try to put in file name field: [N]
and in extension fieed: [E]
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
User avatar
leedlt
Junior Member
Junior Member
Posts: 18
Joined: 2004-05-03, 08:51 UTC
Location: Stuttgart, Germany

A-ha!!!

Post by *leedlt »

Hi djk,

that was it! Actually it is logical. I do the same thing in Solaris.

for I in `ls`
do
J=`echo $I | sed 's/\([0-9]\{2\}\)\.\([0-9]\{2\}\)\.\([0-9]\{4\}\)\(.*\)/\3\.\2\.\1\4/g'`
echo "cp $I out/$J"
cp $I out/$J
done

We always say, "no sooner than you do something right, than it works".
:-)
Many thanks!

Thom
User avatar
vlado
Junior Member
Junior Member
Posts: 28
Joined: 2003-02-07, 00:01 UTC
Location: Slovakia

Post by *vlado »

You can just put the following in filename field (no regexp necessary):
[N7-10].[N4-5].[N1-2][N11-]
(and default [E] in extension field, of course)

Vlado
User avatar
leedlt
Junior Member
Junior Member
Posts: 18
Joined: 2004-05-03, 08:51 UTC
Location: Stuttgart, Germany

He how can read...

Post by *leedlt »

Hi vlado,

:oops: I saw that yesterday after the first reply to my posting.

He who can read...
clearly has an advantage :-)

Thanks anyway

Thom
Post Reply