Thursday, January 19, 2012

Simple TCL script for renaming files

So, I got this bundle of files from work and the file name formatting weren't to my liking. Capitalizations and spaces are things I tend to avoid in Linux when possible as you need to use the backslash escape to get the filenames interpreted properly. Tab auto-complete would allow me to use them, but I just didn't like to see my filenames with all the backslash stuff on. So, I decided to whip out a TCL script to do the work for me. It's largely based off the first simple script I did and only took a few minutes to do.

To use it, you just supply the filepath with all the files you want to be renamed and it'll go through each one for you. The script isn't properly tested, so keep that in mind when using this. Its clean up is basically to change the capitalizations to lower case characters and replace all spaces with dashes.


No comments: