Page 1 of 1
Renamer: Shortening filenames while moving them?
Posted: 10 Aug 2006, 16:37
by SerenusZeitblom
Hi there,
I've got a bunch of graphc files that have a "_XY" at the end of their names - XY is a language identifier f. e. "_EN" for English, "_PL" for Polish.
Now I have to put them in separate langue folders "EN", "PL" - without the identifier: Copy all "<name>_EN.png" into "EN" folder as "<name>.jpg".
Can this be done using Salamander without the need to rename each file individually?
TIA
Franz-Josef
Posted: 10 Aug 2006, 17:25
by omega
You can't move and rename the files simultaneously. What you can do is replace the files _EN.png first using the batch renamer then move them to the EN folder. Repeat the same for the other countries.
Posted: 10 Aug 2006, 17:49
by Jan Rysavy
Yes, it is possible using the Renamer plugin.
0. create subdirectories EN, PL, etc. (Commands > Create Directory)
1. select all desired files (Edit > Select)
2. start Renamer (Plugins > Renamer > Batch Rename)
3. set Mask to *_en.* (only _en files will be affected, look at Preview list)
4. set Options > Rename Relative Paths
5. set New name to en\$(OriginalName)
6. set Search for to _en (this step will remove the _en appendix)
7. press the Rename
Then you can change the EN string to PL (step 4, 6, 7) and Rename again.
Posted: 11 Aug 2006, 12:23
by Lukas Cerman
There is even more convenient way to do this, using regular expressions. See:
0. Create subdirectories EN, PL, etc. (Commands > Create Directory)
1. Select desired files at once, it means all EN,PL,XX files at once.
2. start Renamer (Plugins > Renamer > Batch Rename)
3. Turn on `Rename Relative Path' in `Options' menu.
4. Turn on `Regular expression' check box.
5. In `Search for' write: (.*)_(..)(\..*?)$
6. In `Replace with' write: $2\$1$3
7. Press `Rename'.
Thats all.
To explain the regular expression. All terms in round brackets are saved in internal variables accesed by $1,$2... from the `Replace with'. The numbers are given by order in the regular expression.
.* stands for any string (. dot is any char, * means any repetetition of previous term)
_ stands for _
.. stand for right two characters, each dot for one
\. stands for .
*? stands for nongreedy repetition
$ stands for end of string