Jul 27, 2013

Mass rename on Synology

Sorting through my digital "archives" (*cough*)... A while ago, I showed you how to mass encode audio files from FLAC to MP3 using only the default tools available on a Synology box.

Now, I've got another problem: a large collection of files with weird characters in the filename, showing up as '?' in the Synology GUI... and as plain crap on a MacOS SMB mount (e.g 6KE7HSG.pdf) . Some character encoding issue, I suppose.

So, how do you rename hundreds of files in one ago, filtering crappy and/or unwanted characters in the process? In this case, I'd like to rename [Squadron-Signal] Aircraft in Action n?032 - F-14 Tomcat.pdf (yeah, I'm an aircraft buff, sue me) into n032 - F-14 Tomcat.pdf

On Linux, I'd just use rename(1), but it's not installed on my Synology box, so let's ssh and do it the old way. This should be easy to adapt to your own needs.



sh and sed: what else?

2 comments:

  1. # ipkg install util-linux-ng

    will give you rename:

    $ file /opt/bin/rename
    /opt/bin/rename: symbolic link to `/opt/bin/util-linux-ng-rename'

    ReplyDelete
  2. Thanks for the tip! You know me, always looking for an excuse to do things the hard way ;)

    ReplyDelete