Improve the previous answer a bit:
require 'fileutils' Dir.glob('/path_to_file_directory/*.eml').each do |f| FileUtils.mv f, "#{File.dirname(f)}/#{File.basename(f,'.*')}.html" end
File.basename(f,'.*') give you a name without an extension, otherwise the files will have a filename .eml.html instead of file_name.html
fmendez
source share