Created
October 17, 2014 04:00
-
-
Save ashaw/3dc6d64545c7617134c8 to your computer and use it in GitHub Desktop.
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
color = Dir["./west bay pass 1 color/*"] | |
infra = Dir["./west bay pass 1 infra/*"] | |
color_idx = 0 | |
infra_idx = 0 | |
def mk_filename(idx) | |
prefix = "IMG_" | |
no_str = idx < 1000 ? "0#{idx}" : idx | |
"#{prefix}#{no_str}" | |
end | |
def parse_filename(f) | |
File.basename(f).gsub(/[^\d]/,"").to_i | |
end | |
def orig_basename(f) | |
File.basename(f).gsub(/\.JPG/,"") | |
end | |
color.each do |c| | |
p "moving #{c} to ./wb1sync/#{color_idx}_color.jpg" | |
`mv "#{c}" ./wb1sync/#{color_idx}_color_#{orig_basename(c)}.jpg` | |
color_idx += 1 | |
end | |
infra.each do |c| | |
p "moving #{c} to ./wb1sync/#{infra_idx}_infra.jpg" | |
`mv "#{c}" ./wb1sync/#{infra_idx}_infra_#{orig_basename(c)}.jpg` | |
infra_idx += 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment