Saturday, October 25, 2008

use flac tags to rename files


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"

(Also see the post on converting flac to mp3s)


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...


Anonymous said...

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


thx a ton

mikey said...

Hi will this work on a Mac?

Mario González Sauri said...

Amazing! TX