Skip to content

Instantly share code, notes, and snippets.

View Kequc's full-sized avatar

Kequc

View GitHub Profile
@Kequc
Kequc / gist:8740833
Last active January 15, 2018 09:15
Rename directory of files in random order to simple numerical form
require 'fileutils'
# Set folder path
folder_path = "/User/absolute/path/to/dir"
# Start at number
start = 0
# Group into directories of size
size = 125
# "%07d" for 7 digits ie 0000001.jpg
padding = "%07d"
# Then run this monster