Saturday, October 25, 2008

use flac tags to rename files

#!/bin/bash

for a in *.flac; do
ARTIST=`metaflac "$a" --show-tag=ARTIST | sed s/.*=//g`
TITLE=`metaflac "$a" --show-tag=TITLE | sed s/.*=//g`
TRACKNUMBER=`metaflac "$a" --show-tag=TRACKNUMBER | sed s/.*=//g`
mv "$a" "`printf %02g $TRACKNUMBER` - $ARTIST - $TITLE.flac"
done


(Also see the post on converting flac to mp3s)

7 comments:

Anonymous said...

Thanks for this, helped me solve a problem.

Anonymous said...

thanks, i searched for it.

Mushiro said...

Thanks! I was searching for such a script. Did the trick.

Anonymous said...

Thank you very much, saved me much work!

Anonymous said...

Thanks!

Anonymous said...

thanks was building one in perl. but this worked so well.

system($tagrename);

thx a ton

mikey said...

Hi will this work on a Mac?