Skip to content

Instantly share code, notes, and snippets.

@oquno
Created June 20, 2012 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oquno/2962683 to your computer and use it in GitHub Desktop.
Save oquno/2962683 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'taglib2'
file = ARGV.shift
t = TagLib2::File.new(file)
new = "#{File.dirname(file)}/#{sprintf("%02d", t.track)} #{t.title}.mp3"
File.rename(file, new)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment