how to use the rename plugin

Discussion of bugs and problems found in Altap Salamander. In your reports, please be as descriptive as possible, and report one incident per report. Do not post crash reports here, send us the generated bug report by email instead, please.
john

how to use the rename plugin

Post by john »

hello,

I would like to know how to use the rename plugin to rename for example [test#12]infofile[john].txt to infofile.txt
User avatar
ino
Posts: 440
Joined: 09 Dec 2005, 14:59
Location: Brno, Czech Republic

Re: how to use the rename plugin

Post by ino »

john wrote:hello,

I would like to know how to use the rename plugin to rename for example [test#12]infofile[john].txt to infofile.txt

Hi,
it is really powerful plug-in with many various ways how to rename one or more files at once.

In your case select file [test#12]infofile[john].txt and hit Ctrl+Shift+R to run Rename plug-in.

Now how to rename it:
1) you can use Manual mode - there you can rename it manually the same way as retyping plain text in notepad. When you are done hit the Rename button.

2) you can use New name mode - write directly the new name of the file. Check drop down menu at the right side where you can use "wild-cards", so you can use infofile.$(ExtPart) When you are done hit the Rename button.

3) you can use Replace mode - in the Search for field type string you want to replace, ie [test#12]infofile[john] and in the second line write infofile. Hit the Rename button. When you are done hit the Rename button.

4) you can use Regular expressions - in the Search for field write regular expression you need - in this case [\[[a-zA-Z#0-9]*\] uncheck option Only once in each name and check option Regular expression. This reg.exp. will remove any occurrences of left and right bracket and all letters, numbers and character # within that brackets. When you are done hit the Rename button.

At each step you can see instantly results in the Preview frame in the New name culumn.

Hope it helps a bit ;-)
Edited and optimalized
Last edited by ino on 27 Mar 2008, 07:04, edited 1 time in total.
john

Post by john »

i would like to know how to use the 4th method. I tried typing in the search field but can't do it correctly. What should i put in that field?
User avatar
Ether
Posts: 1471
Joined: 10 May 2007, 16:08
Location: Czech Republic
Contact:

Post by Ether »

Put

Code: Select all

[\[+?][a-z#0-9]*\]
in the search field, check the Regular expression checkbox and uncheck the Only once in each name checkbox.
Ελληνικά rulez.
User avatar
ino
Posts: 440
Joined: 09 Dec 2005, 14:59
Location: Brno, Czech Republic

Post by ino »

When checkbox Only once in each name is uchecked:

Code: Select all

[\[[a-zA-Z0-9#]*\]
or you can use folowing regular expresion without unchecking Only once in each name checkbox:

Code: Select all

(\[[a-zA-Z0-9#]*\])([a-zA-Z0-9]*)(\[[a-zA-Z0-9#]*\])(.[a-z]*)
and replace it with:

Code: Select all

$(2)$(4)
for more information how Altap Salamander supports regular expression reffer to Help
or http://www.altap.cz/salam_en/help/salam ... regexp.htm
or http://www.regular-expressions.info/
and nice cheat sheet could be find here: http://www.ilovejackdaniels.com/cheat-s ... eat-sheet/
john

Post by john »

Thanks for the instructions and links, i'll try to experiment with the use of expressions.
Post Reply