Newbe question - From m**_**_******.jpg to m**_**.jpg

Bulk Rename Utility How-To's

Newbe question - From m**_**_******.jpg to m**_**.jpg

Postby wfr » Mon Nov 20, 2023 10:03 pm

Hi,
I have files with the following structure:

m**_**_******.jpg

The part with the _****** has a variable length. I want to remove this part.
So the end result is:

m**_**.jpg

Example:

m14_01_eynb0e_c_scale,w_867.jpg
should become:
m14_01.jpg

Thank you
wfr
 
Posts: 3
Joined: Mon Nov 20, 2023 9:54 pm

Re: Newbe question

Postby Admin » Tue Nov 21, 2023 12:17 am

From m**_**_******.jpg to m**_**.jpg

Try this

RegEx (1)
Enable Simple flag
Match: m%1_%2_%3.jpg
Replace: m%1_%2.jpg
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm

Re: Newbe question - From m**_**_******.jpg to m**_**.jpg

Postby wfr » Tue Nov 21, 2023 10:52 am

Thank you for the tip, but I couln't get it to work. Did I miss something?

My steps:

RegEx (1):

Match: m%1_%2_%3.jpg
Replace: m%1_%2.jpg
Simple Flag enabled

Files highlighted

Thank you
wfr
 
Posts: 3
Joined: Mon Nov 20, 2023 9:54 pm

Re: Newbe question - From m**_**_******.jpg to m**_**.jpg

Postby Luuk » Tue Nov 21, 2023 11:39 am

It needs a checkmark inside for the menu "Renaming Options, File/Folder Extensions, Rename File Extensions".
But this can be a very dangerous setting, so its good to always remove it when you're finished renaming!
Amother way is adding a checkmark for "Inc.Ext." and then just remove ".jpg" from your "Replace".
Luuk
 
Posts: 706
Joined: Fri Feb 21, 2020 10:58 pm

Re: Newbe question - From m**_**_******.jpg to m**_**.jpg

Postby wfr » Tue Nov 21, 2023 5:10 pm

That works!

Thank you very much!
wfr
 
Posts: 3
Joined: Mon Nov 20, 2023 9:54 pm

Re: Newbe question - From m**_**_******.jpg to m**_**.jpg

Postby therube » Tue Nov 21, 2023 5:16 pm

1:RegEx (do not enable, Simple)
Code: Select all
Match:  (.*)(_.*)
Replace: \1

Match anything, greedily, up to the final _ followed by anything else.
Only keep the first matched part.
therube
 
Posts: 1319
Joined: Mon Jan 18, 2016 6:23 pm

Re: Newbe question - From m**_**_******.jpg to m**_**.jpg

Postby Admin » Wed Nov 22, 2023 11:55 am

Yes, sorry , if you want to ignore the file extension use :
Match: m%1_%2_%3
Replace: m%1_%2
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm


Return to How-To