You are not logged in.
(From Email...)
Let's start with a list of Built-in Presets of the most common missions asked in the forum. What normally simple users couldn't solve without ask for help.
Last edited by den4b (2016-05-13 07:03)
Offline
Let's start with a list of Built-in Presets of the most common missions asked in the forum. What normally simple users couldn't solve without ask for help.
If you want, you can start tracking and documenting the most commonly asked questions and answers on the Wiki.
We can start building the list there first before figuring out how it could be integrated into ReNamer.
Offline
You may consider using the pascalscript to accomplish this feat. It is far more flexible.
consider the following example that handles multiple elements (2 or more) with the ability to change the separator.
We start by defining the old and new separators:
const
old_seperator = ' - ';
new_separator = ' ; ';
Then we declare the variables needed;
var
i : integer;
basename, tempname, ext: WideString;
arr: TStringsArray;
The body of the code begins with "begin", we start by extracting the basename, and the extension of the file you want to rename:
begin
basename := WideExtractBasename(filepath);
ext := WideExtractfileExt(filepath);
assuming that your filename uses a consistent separator such as ' - ', or ';' or whatever the separator is, we then split the basename into an array of elements using the value defined in the old_separator constant.
arr:= WideSplitString(basename, old_seperator);
in this example, the 'last element' is arr[length(arr)-1]
We then proceed to reconstruct the filename with a loop that would handle the elements before the last element.
tempname := arr[length(arr)-1];
for i := 0 to length(arr)-2 do tempname := tempname + new_separator + arr[i];
filename := tempname + ext;
end.
That's all. with the pascalscript, it is easy to modify the code into whatever you want. The pascalscript is attached as well. (you must rename it to .pas file to use it.)
edit: I don't know why the attachment is not showing, however, the entirety of the code is here:
//Rearrange move the last filename element to be the first element
//By: bdpq; hello.bdpq@gmail.com
//you may change the default separator by changing the "old_separator" value;
//also, you can change the new separator by changing the "new_separator" as well;
const
old_separator = ' - ';
new_separator = '-';
var
i : integer;
basename, tempname, ext: WideString;
arr: TStringsArray;
begin
basename := WideExtractBasename(filepath);
ext := WideExtractfileExt(filepath);
arr:= WideSplitString(basename, old_separator);
tempname := arr[length(arr)-1];
for i := 0 to length(arr)-2 do tempname := tempname + new_separator + arr[i];
filename := tempname + ext;
end.
Last edited by bdpq (2016-06-08 23:35)
Offline