Skip to content

Instantly share code, notes, and snippets.

@jm
Created July 26, 2008 00:52
Show Gist options
  • Save jm/2567 to your computer and use it in GitHub Desktop.
Save jm/2567 to your computer and use it in GitHub Desktop.
DIR=/(.*)\.(.*)/
Dir.entries(Dir.pwd).each do |e|
next unless e.match(/[a-z]/)
puts 'moving ' + e + ' to ' + e.gsub(DIR, '\1')
`mkdir #{e.gsub(DIR, '\1')}`
`mv #{e} #{e.gsub(/(.*)\.(.*)/, '\1')}/`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment