Created
May 3, 2024 07:56
-
-
Save foxweb/17abff39ed624bb605d451a755f220fa to your computer and use it in GitHub Desktop.
Sorting and ordering photos/videos from camera by directories named by date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extensions = ['*.MOV', '*.MP4', '*.JPG', '*.DNG', '*.SRT'] | |
dir_list = Dir.glob(extensions) | |
dir_list.map{|f| date = File.mtime(f).strftime('%F'); Dir.mkdir(date) unless Dir.exist?(date); FileUtils.mv(f, date)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment