You are not logged in.
I haven't visited the forum in a while. I hope everyone is in good spirits during these long quarantine days.
My scenario: I have a bunch of ebooks that have long file names. Mostly they are in the form of
"author1, author2, author3, author4, author5 - Really long name of book is here"
Many are over 256 characters long, which causes problems with windows. I don't know if ReNamer is able to work with these types of files, but I'd like to do a bulk-rename. The rule:
If length of file name > 256 chars, then rename that file.
When renaming, keep name of book, but remove authors and deliminator.
*Assume that authors are at the left of the deliminator.
*Deliminator = " - " (i.e. space dash space)
Thoughts? -Steve
Offline
Actually, I found a work-around.... I realized that I can add a "Length" column in my file explorer. I can sort by length, then use ReNamer to rename only the needed items.
Offline
The pascal script below should do the job:
const
MaxFileNameLength = 255;
begin
if Length(FileName) > MaxFileNameLength then
begin
FileName := ReplaceRegEx(FileName, '\A(.*?) - (.*)\Z', '$2', False, True);
end;
end.
You can adjust the MaxFileNameLength constant as you see fit.
Alternatively, if you pre-filter the files and only have those exceeding the desired length, then you can just apply the Regular Expressions rule.
Offline