Search and Replace

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Onnix
Posts: 12
Joined: 14 Aug 2023 15:03

Search and Replace

Post by Onnix »

Hello everyone,
I'm wondering if anyone can help me. I want to find all the files in a folder and change the last character of any file that ends in the number "1" to "_a". For example:

Are there 421 students 1.mp3
Are there 421 students.mp3
Avogadro's number 602 1.mp3
Avogadro's number 602.mp3

The result should look like this:

Are there 421 students _a.mp3
Are there 421 students.mp3
Avogadro's number 602 _a.mp3
Avogadro's number 602.mp3

Thanks for any solution.

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

Re: Search and Replace

Post by highend »

- If all files are in the same folder, just select all files
- If files can also be inside subfolders, switch to a files only branch view, CTRL+A

Right click on the selection
Rename Special - RegExp Rename...
1$ > _a /b
One of my scripts helped you out? Please donate via Paypal

Onnix
Posts: 12
Joined: 14 Aug 2023 15:03

Re: Search and Replace

Post by Onnix »

It doesn't seem to be working.

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

Re: Search and Replace

Post by highend »

v27.20.0304 or newer is required for this pattern, otherwise you would need something like this:
(.+?)1(\.[^.]+?)$ > $1_a$2
One of my scripts helped you out? Please donate via Paypal

Onnix
Posts: 12
Joined: 14 Aug 2023 15:03

Re: Search and Replace

Post by Onnix »

Great. It works perfectly. Thanh you a lot.

Post Reply