Multi-Rename with Regular Expressions in FreeCommander
Posted: 11.01.2019, 19:39
Hi.
Objective: Multi-Rename with Regular Expressions in FreeCommander
Used version: FreeCommander XE 2019 Build 790a 32-bit public
I present my case:
I am working with Regular Expressions to rename a large volume of files using the
Multi-Rename feature.
I have these files as an example:
1 - Getting Started.mp4
2 - Writing Your First.mp4
12 - With Statements.mp4
13 - If Statements.mp4
The final result I would like to obtain using Regular Expressions in Multi-Rename would be the following:
001 - Getting Started.mp4
002 - Writing Your First.mp4
012 - With Statements.mp4
013 - If Statements.mp4
Rules to keep in mind:
1) Solve the problem only with Regular Expressions
2) All files must be renamed with three (3) digits
3) Do not use the Counter Tool to number -> File Name: [c] - [n, 5] ... etc
MY SOLUTION OF MOMENT
----------------------------------
It is carried out in two (2) steps and is as follows:
First step:
--------------
Search for: (^\d\s)(.*)
Replace with: 00$1$2
Yes: Regular Expression
Yes: Exclude extension
Yes: Replace in all cases
This makes the files:
1 - Getting Started.mp4
2 - Writing Your First.mp4
Be renamed by this:
001 - Getting Started.mp4
002 - Writing Your First.mp4
Second step:
-----------------
Search for: (^\d\d\s)(.*)
Replace with: 0$1$2
Yes: Regular Expression
Yes: Exclude extension
Yes: Replace in all cases
This makes the files:
12 - With Statements.mp4
13 - If Statements.mp4
Be renamed by this:
012 - With Statements.mp4
013 - If Statements.mp4
As you can see it takes two (2) steps to rename both groups of files as required
using the Regular Expressions of FreeCommander in Multi-Rename.
However, a text editor such as Notepad++ allows me to handle the Regular Expressions of a
very efficient way.
So for example I can enter the following Regular Expression in Notepad++
Search: (^\d\s.*)|(^\d\d\s.*)
Replace with: (?{1}00\1:0\2)
Yes: Regular Expression
To convert this:
1 - Getting Started.mp4
2 - Writing Your First.mp4
12 - With Statements.mp4
13 - If Statements.mp4
In this other:
001 - Getting Started.mp4
002 - Writing Your First.mp4
012 - With Statements.mp4
013 - If Statements.mp4
The most important thing is that Notepad++ is able to execute this in a single action.
And in this WEB you can see working the Regular Expression:
https://regex101.com/r/5NX7u0/1
THIS ARE MY QUESTIONS:
-----------------------------------
1) Which Regular Expressions engine does FreeCommander use?
2) a) Premise:
Certainly FreeCommander can do searches with Regular Expressions
conditional
b) Question:
Can FreeCommander make conditional replacements using the Regular Expressions
How does Notepad++?
EARLY CONCLUSION
--------------------------
Because of the multiple tests that I have done, I am thinking that FreeCommander is not capable of doing
conditional replacements using Regular Expressions. If so, I would have to continue doing it
in two (2) or more steps as I currently do.
If on the contrary, FreeCommander is enabled for it, what is the correct way to
Write the Regular Expression for a conditional replacement?
I appreciate your responses and your interest in reading my message.
I apologize for my little English since I speak Spanish.
Objective: Multi-Rename with Regular Expressions in FreeCommander
Used version: FreeCommander XE 2019 Build 790a 32-bit public
I present my case:
I am working with Regular Expressions to rename a large volume of files using the
Multi-Rename feature.
I have these files as an example:
1 - Getting Started.mp4
2 - Writing Your First.mp4
12 - With Statements.mp4
13 - If Statements.mp4
The final result I would like to obtain using Regular Expressions in Multi-Rename would be the following:
001 - Getting Started.mp4
002 - Writing Your First.mp4
012 - With Statements.mp4
013 - If Statements.mp4
Rules to keep in mind:
1) Solve the problem only with Regular Expressions
2) All files must be renamed with three (3) digits
3) Do not use the Counter Tool to number -> File Name: [c] - [n, 5] ... etc
MY SOLUTION OF MOMENT
----------------------------------
It is carried out in two (2) steps and is as follows:
First step:
--------------
Search for: (^\d\s)(.*)
Replace with: 00$1$2
Yes: Regular Expression
Yes: Exclude extension
Yes: Replace in all cases
This makes the files:
1 - Getting Started.mp4
2 - Writing Your First.mp4
Be renamed by this:
001 - Getting Started.mp4
002 - Writing Your First.mp4
Second step:
-----------------
Search for: (^\d\d\s)(.*)
Replace with: 0$1$2
Yes: Regular Expression
Yes: Exclude extension
Yes: Replace in all cases
This makes the files:
12 - With Statements.mp4
13 - If Statements.mp4
Be renamed by this:
012 - With Statements.mp4
013 - If Statements.mp4
As you can see it takes two (2) steps to rename both groups of files as required
using the Regular Expressions of FreeCommander in Multi-Rename.
However, a text editor such as Notepad++ allows me to handle the Regular Expressions of a
very efficient way.
So for example I can enter the following Regular Expression in Notepad++
Search: (^\d\s.*)|(^\d\d\s.*)
Replace with: (?{1}00\1:0\2)
Yes: Regular Expression
To convert this:
1 - Getting Started.mp4
2 - Writing Your First.mp4
12 - With Statements.mp4
13 - If Statements.mp4
In this other:
001 - Getting Started.mp4
002 - Writing Your First.mp4
012 - With Statements.mp4
013 - If Statements.mp4
The most important thing is that Notepad++ is able to execute this in a single action.
And in this WEB you can see working the Regular Expression:
https://regex101.com/r/5NX7u0/1
THIS ARE MY QUESTIONS:
-----------------------------------
1) Which Regular Expressions engine does FreeCommander use?
2) a) Premise:
Certainly FreeCommander can do searches with Regular Expressions
conditional
b) Question:
Can FreeCommander make conditional replacements using the Regular Expressions
How does Notepad++?
EARLY CONCLUSION
--------------------------
Because of the multiple tests that I have done, I am thinking that FreeCommander is not capable of doing
conditional replacements using Regular Expressions. If so, I would have to continue doing it
in two (2) or more steps as I currently do.
If on the contrary, FreeCommander is enabled for it, what is the correct way to
Write the Regular Expression for a conditional replacement?
I appreciate your responses and your interest in reading my message.
I apologize for my little English since I speak Spanish.