Page 1 of 1
How to regex rename files like this?
Posted: 05 Sep 2017 04:31
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
Re: How to regex rename files like this?
Posted: 05 Sep 2017 05:09
by RalphM
Why use a regex for this?
A simple search and replace rename with the pattern "./ " should do the trick.
PicPick_231.jpg
Re: How to regex rename files like this?
Posted: 05 Sep 2017 05:19
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
Re: How to regex rename files like this?
Posted: 05 Sep 2017 08:19
by highend
Can't be done within a single expression
Re: How to regex rename files like this?
Posted: 10 May 2026 11:00
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.
Re: How to regex rename files like this?
Posted: 10 May 2026 11:08
by highend
If he was still searching for a solution 9 years after his post? ...