Multi-rename tool: how to keep only few letters on name.

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
useybrain
Junior Member
Junior Member
Posts: 3
Joined: 2024-01-24, 11:45 UTC

Multi-rename tool: how to keep only few letters on name.

Post by *useybrain »

Multi-rename tool: how to keep only few letters on name.
I have:
ALEKSANER PLACE ch1_20220701150134_T.jpg
ALEKSANER PLACE_ch1_20220701150124_T.jpg
ALEKSANER_PLACE_ch1_20220701150114_E.jpg
ALEKSANER PLACE ALEKSANDER PLACEC ch1_20230701150134_T.jpg
ALEKSANER_PLACE_ALEKSANER_PLACE_ch1_20220801150134_E.jpg
ALEKSANER PLACE ch1_20250701150134_T.jpg

want to change all the names to keep only this format:
ch1_20220701150134.jpg

only the chanel name "ch1" with "_" and date.jpg
User avatar
Stefan2
Power Member
Power Member
Posts: 4159
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Multi-rename tool: how to keep only few letters on name.

Post by *Stefan2 »

Hello and welcome 2useybrain


FROM:
ALEKSANER PLACE ch1_20220701150134_T.jpg
ALEKSANER PLACE_ch1_20220701150124_T.jpg
ALEKSANER_PLACE_ch1_20220701150114_E.jpg
ALEKSANER PLACE ALEKSANDER PLACEC ch1_20230701150134_T.jpg
ALEKSANER_PLACE_ALEKSANER_PLACE_ch1_20220801150134_E.jpg
ALEKSANER PLACE ch1_20250701150134_T.jpg

TO:
ch1_20220701150114_E.jpg
ch1_20220701150124_T.jpg
ch1_20220701150134_T.jpg
ch1_20220801150134_E.jpg
ch1_20230701150134_T.jpg
ch1_20250701150134_T.jpg




Do in MRT:
Search for: (ch1.+)
Replace with: $1
[x]RegEx
[x]Subst



#################


Update based on useybrain answer as I forgot the trailing letters (but I do not handle here the newly added "_main" condition)



FROM:
ALEKSANER PLACE ch1_20220701150134_T.jpg
ALEKSANER PLACE_ch1_20220701150124_T.jpg

TO:
ch1_20220701150114.jpg
ch1_20220701150124.jpg

Do in MRT:
Search for: (ch1.+)_.
Replace with: $1
[x]RegEx
[x]Subst




 
useybrain
Junior Member
Junior Member
Posts: 3
Joined: 2024-01-24, 11:45 UTC

Re: Multi-rename tool: how to keep only few letters on name.

Post by *useybrain »

not working.
I have DIFERENT DATES! And I dont want "_T" and "_E" on end of the name.
And sometimes I have:
ALEKSANDER PLACE _main_20220304050607_T.jpg

and I want:
ch1_20220304050607.jpg

I want:
erase EVERTING AT START AND END WITHOUT "20220304050607" (12 numbers) + ADD "ch1_" BEFORE DATE.
JOUBE
Power Member
Power Member
Posts: 1477
Joined: 2004-07-08, 08:58 UTC

Re: Multi-rename tool: how to keep only few letters on name.

Post by *JOUBE »

Try it youself here for best results: https://regex101.com/ with the hints of stefan2 and on that webpage

HTH

Joube
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Multi-rename tool: how to keep only few letters on name.

Post by *white »

useybrain wrote: 2024-01-24, 12:22 UTC erase EVERTING AT START AND END WITHOUT "20220304050607" (12 numbers) + ADD "ch1_" BEFORE DATE.

Code: Select all

Search for:   \d{12}
Replace with: ch1_$0

[ ] [E]
[x] RegEx
[x] Subst
(Change 12 to 14 if you meant to say 14)
useybrain
Junior Member
Junior Member
Posts: 3
Joined: 2024-01-24, 11:45 UTC

Re: Multi-rename tool: how to keep only few letters on name.

Post by *useybrain »

EXACLY THIS.
You save me 8h of work :)))
Very thks my friend! Very.
14 DIGIT of course. My mistake!
REGARDS PEOPLE

Code: Select all

Search for:   \d{12}
Replace with: ch1_$0

[ ] [E]
[x] RegEx
[x] Subst
(Change 12 to 14 if you meant to say 14)
Post Reply