Page 1 of 1

Problem to rename files.

Posted: 2021-06-22 06:44:51
by rh_1363
Hi
My name is Reza.
I’ve used your software for rename my files.
Today I face a problem to rename my files. I’ve tried lots of method, but it hasn’t worked.
Please help me to find the solution.
I have lots of file downloaded from youtube and all of them have special suffix at the end (some trivial code). I want to remove these trivial codes at the end of my files.
For example this file has this name:
God_Delusion_by_Richard_Dawkins_[C85pvi87WK8]_[tag18].mp4
And I want to remove this: _[C85pvi87WK8]_[tag18]
I know the pattern is: _[???????????]_[?????]
But I couldn’t find a correct method to remove this irritating suffix.
In addition you can see the screenshot of my files in attachment.
I need your help to solve my problem.
Thanks a lot.

Re: Problem to rename files.

Posted: 2021-06-23 14:42:41
by antp
Hi,
As replied by e-mail, but I post it here also in case someone else finds the question via a search:

This is possible using regular expressions, though that the syntax is not the easiest :)
If you use the following expression pattern:

Code: Select all

([^\[]+)((_\[\w+\])+)\.(\w+)
and the following new name template:

Code: Select all

$1.$4
It should work as expected.

What it searches:
([^\[]+) = group 1, characters others than [
((_\[\w+\])+) = group 2 & 3 : number and letter characters between brackets and with an underscore in front, that may be repeated several times
\.(\w+)= group 4, the extension : a dot followed by number and letters