For my own future reference and your enjoyment, here's a neat little oneliner to transform 01 - some song.mp3 into 01 - Some Song.mp3:
rename "s/([^._'])\b(\w)(\w*)/\$1\U\$2\L\$3/g" *.mp3
It needs the prename
utility from Perl, which on Ubuntu is available by default under the name rename
.
3 comments:
I use the script at http://pastesite.com/14217 as a macos service. It's basically a regex, and it handles edgecases like can't correctly.
just use
prename 'y/A-Z/a-z/' *
If I'm not mistaken, that command will downcase everything. Not quite what I intended.
Post a Comment