I've created a tool that renames files using regular expressions. It can be invoked like this:
Examples:
I've pushed the code to GitHub: https://github.com/serpent7776/rer
I hope it will be usable for someone.
rer /pattern/replacement/modifiers file [file [...]]
. Each file is matched against a pattern; if a match is found the file is renamed.Examples:
- Rename all IMG* files to picture* (e.g. IMG_1000.jpg to picture_1000.jpg):
rer /IMG/picture/ IMG*
- Swap first word with second (renaming foo-bar to bar-foo, foo-123 to 123-foo):
rer '/(\w+)-(\w+)/\2-\1/' foo-bar foo-123
I've pushed the code to GitHub: https://github.com/serpent7776/rer
I hope it will be usable for someone.
Last edited by a moderator: