Skip to content

Instantly share code, notes, and snippets.

@vikjam
Last active July 31, 2017 14:36
Show Gist options
  • Save vikjam/489da89078141920430c427d5758ea9e to your computer and use it in GitHub Desktop.
Save vikjam/489da89078141920430c427d5758ea9e to your computer and use it in GitHub Desktop.
Quick renaming in Ruby
Dir.glob('*.mp3') do | the_filename |
track = the_filename[0..2].strip()
File.rename(the_filename, "05-#{track}.mp3")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment