Replace characters between start- and end- positions in name

Would you like Bulk Rename Utility to offer new functionality? Post your comments here!

Replace characters between start- and end- positions in name

Postby DaveTheBatMan » Mon Dec 11, 2017 2:26 pm

Hi --

I love this program, and have been trying to find a way to replace characters between a start- position and an end- position. As a (rather specific) example, let's say I have

Filename_Test_1.2017-12-11.This.Is.A.Sample.txt

Here, I'd like to replace the '.' characters in "This.Is.A.Sample" with ' ', which I could do by specifying
Replace character, Replace: '.'
Replace character, With: ' '
Start Position: 28
End Position: blank (which would signify everything up to the end)

In my example, I would have a large group of files where the first 26 characters are the same, then a separating '.', and then everything starting at character 28 is different.

I've tried multiple incarnations of RegEx sequences, but I can't seem to find a universal RegEx that would work. And, even if I could, I think this might be a handy tweak to an already-very-powerful program.

Thanks for listening1

Regards,

David C. Battistoli
DaveTheBatMan
 
Posts: 1
Joined: Mon Dec 11, 2017 2:12 pm

Re: Replace characters between start- and end- positions in name

Postby therube » Mon Dec 11, 2017 9:30 pm

If you want to cut the opening 27-characters of each filename, try:

1:Regex
Code: Select all
Match:  (^.{27})(.*)
Replace:  \2
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm


Return to Suggestions


cron