All pastes #629379 Raw Edit

Someone

public ruby v1 · immutable
·published 2007-07-22 06:36 UTC
rendered paste body
require 'find'Find.find(ARGV.shift) do |path|  if path =~ /mp3$/i    tags = `id3info "#{path}"`    artist = tags.scan(/TP1 .*?: (.*?)$/)[0][0]    album = tags.scan(/TAL .*?: (.*?)$/)[0][0]    directory = "#{artist} - #{album}"    directory = Dir.new(directory) rescue Dir.mkdir(directory)    puts "mv #{path} #{directory}"  endend