multi-rename tool question

English support forum

Moderators: Hacker, petermad, Stefan2, white

User avatar
Sam_Zen
Power Member
Power Member
Posts: 700
Joined: 2005-02-08, 22:59 UTC
Location: NL
Contact:

Post by *Sam_Zen »

2 dBLOOD
I'm not from an english region either, and believe me, this is one of the most complicated posts I've ever seen.
I just don't understand what you are talking about.
The part "the .BBB files will be going in between the XXX and YYY" suggested me, that you are maybe looking for a
correct order of files vertically on your screen.

The default order of viewing files is sorted according to the ASCII-set regarding the first character.
So forcing a list to have another order can be done by adding a leading character to the filename.
With the attention that the 0-9 numbers come first, before the alfabet.
0.618033988
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

It's not complicated at all:
Filename 1: XXX-YYY.AAA
Filename 2: XXX-VVV-YYY.BBB
with XXX and YYY part being identical.

Expectation:
XXX-YYY.AAA renamed to XXX-VVV-YYY.AAA

But, of course it's not possible to do crazy stuff like that in TC...

You need to write a batch or a script (for example with AutoHotkey) that reads all filenames containing -VVV- from a given directory, strips the -VVV- part to get the original .AAA filenames and then renames the original .AAA files.

Icfu
This account is for sale
dBLOOD
Junior Member
Junior Member
Posts: 12
Joined: 2006-05-06, 05:07 UTC

Post by *dBLOOD »

icfu wrote:It's not complicated at all:
Filename 1: XXX-YYY.AAA
Filename 2: XXX-VVV-YYY.BBB
with XXX and YYY part being identical.

Expectation:
XXX-YYY.AAA renamed to XXX-VVV-YYY.AAA

But, of course it's not possible to do crazy stuff like that in TC...

You need to write a batch or a script (for example with AutoHotkey) that reads all filenames containing -VVV- from a given directory, strips the -VVV- part to get the original .AAA filenames and then renames the original .AAA files.

Icfu
Thank you This is it!
BUT there is one additional thing... the files are actually in pairs, like:

XXX-YYY1.AAA
XXX-VVV1-YYY1.BBB

XXX-YYY2.AAA
XXX-VVV2-YYY2.BBB

etc.

Yup, its crazy :-)

Still thx :-)

BTW, is there a plug-in, wich can load parts of a filename? :-(
#142031 Personal licence
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

BUT there is one additional thing... the files are actually in pairs, like:
I have understood that. ;)
BTW, is there a plug-in, wich can load parts of a filename?
There is:
http://www.totalcmd.net/plugring/regexp_wdx.html

A newer version is here, direct download:
http://wincmd.ru/files/regexp_wdx_0.1e.rar

Please see this thread, in which Lev has created the plugin:
http://www.ghisler.ch/board/viewtopic.php?t=8180

Adjust this in regexp.ini:

Code: Select all

[Regexp]
Rule=VVV

[VVV]
Find="-.+-"
Change=""
Then add custom column with regexp plugin, in this column you will see -VVV- part stripped.

Also TC itself allows to show only parts of filename with a special syntax, but it won't help you with the problem. Please press F1 when you are configuring a custom column:

Code: Select all

[=pluginname.fieldname.unit:4-7]
Icfu
This account is for sale
dBLOOD
Junior Member
Junior Member
Posts: 12
Joined: 2006-05-06, 05:07 UTC

Post by *dBLOOD »

To icfu

Sorry, by loading i was ment loading into MRT...

I mean:
1. Load a part of one of the pair's filename.
2. insert it into the other one file's name of that pair.
3. doing this with multiple pairs of filenames, automatically
#142031 Personal licence
User avatar
white
Power Member
Power Member
Posts: 5979
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

dBLOOD wrote: BUT there is one additional thing... the files are actually in pairs, like:

XXX-YYY1.AAA
XXX-VVV1-YYY1.BBB

XXX-YYY2.AAA
XXX-VVV2-YYY2.BBB
Are XXX, AAA and BBB always the same?
Are you using Windos XP?
Are AAA, BBB, XXX, YYY and VVV always three characters long?
dBLOOD
Junior Member
Junior Member
Posts: 12
Joined: 2006-05-06, 05:07 UTC

Post by *dBLOOD »

white wrote: Are XXX, AAA and BBB always the same?
Are you using Windos XP?
Are AAA, BBB, XXX, YYY and VVV always three characters long?
Well...
The trouble is, that the XXX and YYY parts are different by each pair of files.
AAA and BBB are 3 chrs long, the other parts are different.
XXX and YYY parts are NOT 3 chrs long, VVV's length is different by each .BBB file, but NOT 3 chrs long either...
#142031 Personal licence
User avatar
white
Power Member
Power Member
Posts: 5979
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

dBLOOD wrote: Well...
The trouble is, that the XXX and YYY parts are different by each pair of files.
AAA and BBB are 3 chrs long, the other parts are different.
XXX and YYY parts are NOT 3 chrs long, VVV's length is different by each .BBB file, but NOT 3 chrs long either...
If I understand you correctly, it should not be too hard to solve using Window XP's cmd.exe. I think it could be done with only one FOR statement. This could then be assigned to a button in Total Commander if you wish.
User avatar
white
Power Member
Power Member
Posts: 5979
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

Something like this:

Command: cmd /c
Parameters: for /f "delims=-. tokens=1,2,3" %%i in ('dir /b *-*-*.bbb') do @if exist "%%i-%%k.aaa" ren "%%i-%%k.aaa" "%%i-%%j-%%k.aaa"
dBLOOD
Junior Member
Junior Member
Posts: 12
Joined: 2006-05-06, 05:07 UTC

Post by *dBLOOD »

white wrote:Something like this:

Command: cmd /c
Parameters: for /f "delims=-. tokens=1,2,3" %%i in ('dir /b *-*-*.bbb') do @if exist "%%i-%%k.aaa" ren "%%i-%%k.aaa" "%%i-%%j-%%k.aaa"
THX white, I'm total zero with scripts, i couldn't make it :-D
#142031 Personal licence
Post Reply