#!/usr/bin/ruby artist = "" album = "" tracks = [] ARGV.each do |f| b = File.basename(f, '.mp3') IO.popen("metaguru '#{f}'").each do |l| if l =~ /^\s*Track\s*:/ x = l[11, l.length] album = x[0, x.length - 2] elsif l =~ /^\s*Artist\s*:/ x = l[11, l.length] artist = x[0, x.length - 2] elsif l =~ /^\s*TXXX/ x = l[43, l.length] x = x[0, x.length - 12] x.gsub(/([^<]+)<\/Name>