Hi,
I am trying to use Batch Rename with Regular Expressions and want to match the end of a name but it seems that this does not work in Salamander 2.51.
Batch Rename RegEx End of Name
Batch Rename RegEx End of Name
- Attachments
-
- Sal251_BatchRenameBug.gif (9.85 KiB) Viewed 11920 times
-
- Posts: 593
- Joined: 09 Dec 2005, 17:30
- Location: a step further
- Contact:
The '$' sign is end of RE. Not end of file name. That means, that i.e. means three characters at the end.
Code: Select all
...$
Jiri {x2} Cincura
Re: Batch Rename RegEx End of Name
Hi, as Jiri wrote the dolar sign means end of line. It specify the position - in your example you are missing what you want to search for, you have only specified the "at the end".
Usage example:
Lets say you have filename jpg_jpg_01.jpg and you wan to rename the last occurance of "jpg". In this case you must search for expresion: jpg$
Usage example:
Lets say you have filename jpg_jpg_01.jpg and you wan to rename the last occurance of "jpg". In this case you must search for expresion: jpg$
- Attachments
-
- Clipbrd1.png (9.45 KiB) Viewed 11905 times
Batch Rename RegEx End of Name
Hi,
thanks for your feedback.
I just wanted to append something at the end of each filename.
From what you wrote the solution for this would be to capture the last character in a group:
(.)$
and consider this in the replacement expression:
$(0)test
thanks for your feedback.
I just wanted to append something at the end of each filename.
From what you wrote the solution for this would be to capture the last character in a group:
(.)$
and consider this in the replacement expression:
$(0)test
Re: Batch Rename RegEx End of Name
To add something at the end of the filename use edit box New name with parameter $(OriginalName)somethinglou wrote:I just wanted to append something at the end of each filename.
-
- ALTAP Staff
- Posts: 1112
- Joined: 08 Dec 2005, 09:13
- Location: Novy Bor, Czech Republic
- Contact:
It works (Renamer uses extended version of this library). Try to rename file "todo.txt", Search for: "t$", Replace with: "X", turn off Only once in each name, turn on Regular expression. Result is "todo.txX". If you use only "t" in Search for, the result will be "Xodo.XxX".ether wrote:The $ sign doesn't work by itself in the regex library from Henry Spencer, which is integrated in Salamander.
So the Regular expression solution for lou is to search for (t$) including brackets and replace it with $1something and turn off Only once in each name, turn on Regular expression to append something at the end of each filename as descibed Petr Solin.Petr Solin wrote: It works (Renamer uses extended version of this library). Try to rename file "todo.txt", Search for: "t$", Replace with: "X", turn off Only once in each name, turn on Regular expression. Result is "todo.txX". If you use only "t" in Search for, the result will be "Xodo.XxX".
-
- ALTAP Staff
- Posts: 1112
- Joined: 08 Dec 2005, 09:13
- Location: Novy Bor, Czech Republic
- Contact:
I think the solution using $(OriginalName)something is much easier, but if you want to use regular expression, search rather for (.)$, it's always working (not only for names ending with t).ino wrote:So the Regular expression solution for lou is to search for (t$) including brackets and replace it with $1something and turn off Only once in each name, turn on Regular expression to append something at the end of each filename as descibed Petr Solin.