folder_path = "C:\\MyDocs\\Work\\Venture\\eStore\\New folder"
puts "Renaming files..."
puts folder_path
Dir.open(folder_path).each do |p|
next if File.extname(p) != ".mp4"
filename = File.basename(p)
newname = filename.gsub 'School - Episode ', 'School - Episode 0'
newname = newname
puts "#{folder_path}/#{p} #{folder_path}/#{newname}"
File.rename( "#{folder_path}/#{p}", "#{folder_path}/#{newname}")
end
puts "Renaming complete."
Comments
Post a Comment