i am doing some renaming of files and folders and i hoped somebody could help me.
i wish to remove characters from the beginning and/or end of the file name and the folder name.
i've searched the forums and found a way to do it using a button or regular expression for the files and another button or regular expression for the folders - is there anyway to do both with a single button or regular expression?
the file rename doesn't work with folders and if i modify it so that it does - it removes the extension from file names.
i would also like to know if there is a way to take a file name and folder name and remove a string from a part of the file name and move it to another - i.e. part 1 interesting thing.avi to interesting thing part 1.avi
You can specify whether the rename is to operate on files or folders by using the type argument in the rename command.
Type=files
Type=dirs
So add type=files to the end of the the files rename command,
and add type=dirs to the end of the folders rename command.
Both renames can then be put in the same button, just use separate lines.
i've had time to try it out and it is really very good - you don't have to know how to write expressions - a lot of the options are available from drop down menus. it took 10 minutes to achieve success with the rename which i'd been struggling with all day in directory opus.
i'd much prefer to use directory opus but in this case bulk rename utility was powerful and easy
@set numChars = {dlgstring|Enter Number of Characters to Remove at Start}
Rename TYPE=files REGEXP PATTERN ".(.+)(\..*)#{$numChars}" TO "\1\2" AUTORENAME
Rename TYPE=dirs REGEXP PATTERN ".(.+)#{$numChars}" TO "\1" AUTORENAME
Edit: Changed \1\2 on the last line to just \1 -- the old version was incorrect, but in a harmless way.
This will move however many characters you specify from the start of the names to the end of the names:
@set numChars = {dlgstring|Enter Number of Characters to Move to the End}
Rename TYPE=files REGEXP PATTERN "(.)(.+)(\..*)#{$numChars}" TO "\2\1\3" AUTORENAME
Rename TYPE=dirs REGEXP PATTERN "(.)(.+)#{$numChars}" TO "\2\1" AUTORENAME
BTW: I noticed a (harmless) mistake in my previous button. I've corrected the post above.