How to do this with Multi-rename?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Ackriss
Junior Member
Junior Member
Posts: 4
Joined: 2024-01-30, 15:22 UTC

How to do this with Multi-rename?

Post by *Ackriss »

Hello,

I'm a Regex noob and can figure out how to do this.

What I would like to do is search and renaming files wile searching for specific list of sequential numbers and replacing the results with another specific list of sequential numbers.

The file names to search for will contain sequential numbers like the list below, in one search:
064
065
Through.
136

Or in another search:
342
343
Through.
481

Nothing higher then three digits long.

Then I would like to change the found sequential numbers to a list like:
001
002
003
004
etc...

For both search cases.

Can this be done? and how please?
Thank you.
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1013
Joined: 2004-07-29, 11:00 UTC

Re: How to do this with Multi-rename?

Post by *ZoSTeR »

 
I'm afraid you have to provide more specific examples...

Do the numbers always have three digits?
Are the numbers always at the same position?
Does the rest of the file name differ for each file?

e.g.:
SomeFile_012.ext
SomeFile_427.ext
SomeFile_788.ext

is a big difference to:
Another_12_file.ext
different_file_256.ext
yet_777_another_file.ext
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: How to do this with Multi-rename?

Post by *beb »

2Ackriss
for that specific scenario it would be enough something as follows:
Rename mask:

Code: Select all

[C] [N5-]
or (if the fourth symbol is also important; anyway, you can play here watching the renaming results preview):

Code: Select all

[C] [N4-]
Define counter [C]:

Code: Select all

Digits [3]
Image: https://i.imgur.com/UoILTZ6.png
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
Ackriss
Junior Member
Junior Member
Posts: 4
Joined: 2024-01-30, 15:22 UTC

Re: How to do this with Multi-rename?

Post by *Ackriss »

Sorry for the lack of detail.

File name format is always " SomeFile_E012.ext, SomeFile_E013.ext. SomeFile_E014.ext...etc. " in sequential order, from the last set of three numbers

Then I would like to change the last set of three numbers and replace in with " SomeFile_E001.ext, SomeFile_E002.ext, SomeFile_E002.ext... etc. "

So if I have selected fifty files named " SomeFile_E213.ext, SomeFile_E214.ext " through " SomeFile_E268.ext " the the resulting fifty file names would change to " SomeFile_E001.ext, SomeFile_E002.ext " through " SomeFile_E050.ext "


Or a selected set of four files names:
"SomeFile_E322.ext" To "SomeFile_E001.ext"
"SomeFile_E323.ext" To "SomeFile_E002.ext"
"SomeFile_E324.ext" To "SomeFile_E003.ext"
"SomeFile_E325.ext" To "SomeFile_E004.ext"

The selected file always have the digits in numeral order with no missing order sequence. Always 1, 2, 3, 4 . Not 1, 2, 3, 5

The given file sets that need changing, will be copied to separate directory's before hand.

I hope I given enough info.

Thanks for the help.
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: How to do this with Multi-rename?

Post by *beb »

2Ackriss

Code: Select all

[N1-10][C][N14-]
Image: https://i.imgur.com/Cyekk8i.png
Explanation:
[N1-10] - we take the original file names and use their symbols from 1 to 10 as a new names' prefix.
[C] - we insert a counter here which starts from 1 and contains three digits.
([N11-13-] - we miss/forget three unwanted/obsolete numbering symbols from the original file names, from 11 to 13th ones)
[N14-] - we take all the rest of the meaningful symbols starting from 14 and until the end (no matter wherever it happens to be, hence 14-).
(we do not touch the extension, keeping it intact [E])
We're watching the renaming results preview, and if it looks satisfactory, we hit [Start!]
Note.
This is not a single available approach.
You can hit the [N#-#] Range big button there and may want to prefer the other ways to count symbols (from the end, in the middle, etc.)
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
Ackriss
Junior Member
Junior Member
Posts: 4
Joined: 2024-01-30, 15:22 UTC

Re: How to do this with Multi-rename?

Post by *Ackriss »

Thank for the tip @Bob

I've got it figured out now.

The magic to add was:

Code: Select all

 [N1-13][C]
Thanks again.
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: How to do this with Multi-rename?

Post by *sqa_wizard »

What about

Code: Select all

[N1--4][C:3]
Just take the whole name but the last 4 and add a 3-digit counter
#5767 Personal license
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: How to do this with Multi-rename?

Post by *beb »

2Ackriss
You are welcome.
Your example is comparably predictable.
Had your files been not that positionally consistent (see the ZoSTeR's examples), we would have had much more fun here.
Cheers.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: How to do this with Multi-rename?

Post by *beb »

sqa_wizard wrote: 2024-01-30, 22:22 UTC

Code: Select all

[N1--4][C:3]
Just take the whole name but the last 4 and add a 3-digit counter
This is another good practical example. Thank you.
If the Ackriss's files weren't that consistent (had prefixes of different lengths before the numbering part but at the same time went without random suffixes thereafter) it would be the main solution.
Last edited by beb on 2024-01-30, 22:48 UTC, edited 1 time in total.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
Ackriss
Junior Member
Junior Member
Posts: 4
Joined: 2024-01-30, 15:22 UTC

Re: How to do this with Multi-rename?

Post by *Ackriss »

I'm bookmaking this for further reference. Because of the great tips i have received.

Many Thanks to @Bob And @sqa_wizard.


Edit: I'm Sorry @ "Beb" I have been calling you Bob. glasses must have been dirty. my mistake, sorry.
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1013
Joined: 2004-07-29, 11:00 UTC

Re: How to do this with Multi-rename?

Post by *ZoSTeR »

sqa_wizard wrote: 2024-01-30, 22:22 UTC What about

Code: Select all

[N1--4][C:3]
Just take the whole name but the last 4 and add a 3-digit counter
Not to be nitpicky, but to make it more understandable why "-4":

[N1--4] should be translated as: Take the first to the fourth last character.
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: How to do this with Multi-rename?

Post by *beb »

Ackriss wrote: 2024-01-30, 22:48 UTC I'm Sorry @ "Beb" I have been calling you Bob...
It ain't a big deal, never mind. What matters is the solution you have found.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
Post Reply