Same start, different from there until .extension

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
AugerJ
Posts: 54
Joined: 19 Jul 2016 06:27

Same start, different from there until .extension

Post by AugerJ »

Hello. There's a bunch of files with sequences like these in their names:
_2020 08 11_13 28 45_1_113
_2020 08 04_23 01 46_1_678
etc.
Same syntax and first four digits (2020), the rest can vary.
It looks like this:
Name_2020 08 04_23 01 46_1_678.extension

I want it to look like this:
Name.extension

What pattern should I use in (presumably) Rename Special: Search And Replace ?

Thanks.

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Same start, different from there until .extension

Post by highend »

In search and replace? Better none^^
regexp rename: ^(.+?)(_\d{4}.+\.)(.+) > $1.$3
One of my scripts helped you out? Please donate via Paypal

AugerJ
Posts: 54
Joined: 19 Jul 2016 06:27

Re: Same start, different from there until .extension

Post by AugerJ »

Thanks!
And if I decide to keep "_2020":
Name_2020.extension
how will the pattern look?

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Same start, different from there until .extension

Post by highend »

Then the first capturing groups ends after the } and not after the ? and obviously the second begins right after it...
One of my scripts helped you out? Please donate via Paypal

AugerJ
Posts: 54
Joined: 19 Jul 2016 06:27

Re: Same start, different from there until .extension

Post by AugerJ »

Thanks. Turns out, some names were more complex. So, the 1st way + some files individually... )

Post Reply