How to regex rename files like this?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
zBernie
Posts: 181
Joined: 08 Dec 2016 17:20

How to regex rename files like this?

Post by zBernie »

Can someone tell me how to remove the dots in the file below using a regex rename? I'm accustomed to *nix regex expressions, and can't seem to get it to work.

-Thanks


BEFORE:
This.Is.The.File.34244.txt

AFTER:
This Is The File 34244.txt

RalphM
Posts: 2085
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: How to regex rename files like this?

Post by RalphM »

Why use a regex for this?
A simple search and replace rename with the pattern "./ " should do the trick.
PicPick_231.jpg
You do not have the required permissions to view the files attached to this post.
Ralph :)
(OS: W11 25H2 Home x64 - XY: Current x64 beta - Office 2024 64-bit - Display: 1920x1080 @ 125%)

zBernie
Posts: 181
Joined: 08 Dec 2016 17:20

Re: How to regex rename files like this?

Post by zBernie »

RalphM wrote:Why use a regex for this?
A simple search and replace rename with the pattern "./ " should do the trick.

PicPick_231.jpg

My mistake, I wanted to remove more text in the file like this:

This.Is.The.File.34244.remove.up.to.extension.txt

This Is The File 34244.txt

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

Re: How to regex rename files like this?

Post by highend »

Can't be done within a single expression
One of my scripts helped you out? Please donate via Paypal

TGE
Posts: 13
Joined: 23 Dec 2020 21:52

Re: How to regex rename files like this?

Post by TGE »

Assuming the number of words before the file numbering are consistent, it should technically be possible with something similar to:

Code: Select all

^([^\.]+)\.([^\.]+)\.([^\.]+)\.([^\.]+)\.(\d\d\d\d\d).+$ > $1 $2 $3 $4 $5
I'm assuming the number of words does change though. In that you could maybe use the free version of Advanced Renamer if you're using Windows. Personally, I use Flash Renamer because I bought a license years ago. Both programs make it fairly simple to stack and bundle renaming schemes into presets to tackle fairly complicated renaming tasks without having to resort to scripting. Although both also have scripting options.

Then again I imagine its also possible to script a solution in XYplorer, but I'm not really that familiar with it's scripting capabilities. Not a programmer, just tend to learn enough here and there to make solutions if I can't find an existing one.

These days you can also wrestle AI (if you have access) into creating functional code/scripts, and sometimes even whole simple apps/programs.
~Eric
Windows 10 32-bit
Screen Scaling 100%

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

Re: How to regex rename files like this?

Post by highend »

If he was still searching for a solution 9 years after his post? ...
One of my scripts helped you out? Please donate via Paypal

Post Reply