How to batch rename files with the leftmost characters

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
shadowtank754
Posts: 1
Joined: 30 Sep 2024 19:05

How to batch rename files with the leftmost characters

Post by shadowtank754 »

Hello, I have a set of files in a folder that all share the naming format of "streetaddress"!"string of random numbers and letters", example: "123 Main street!AD34GGT7JKVJG970879786IB6".

I want to batch rename all the files so that they keep the leftmost text up until it hits the ! at which point the ! and everything right of it are removed, so using the example above after the rename it would become 123 Main Street.

I'm new to using the more advanced features of xyplorer and would appreciate the help, thanks!

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

Re: How to batch rename files with the leftmost characters

Post by highend »

Use the regex rename option with this pattern:
^(.+?)(!.*?)(\.[^.]+?)$ > $1$3
One of my scripts helped you out? Please donate via Paypal

Post Reply