Created
April 11, 2015 16:34
-
-
Save rctay/6e583e956c37a310c2f7 to your computer and use it in GitHub Desktop.
append EXIF date taken to filename
This file contains 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
# produce lines like | |
# | |
# mv "./IMG_8869.jpg" "2015-03-29_19-08-01_IMG_8869.jpg" | |
# | |
find \( -name 'DSC_*' -or -name 'IMG_*' -or -name 'GOPR*' \) -and -iname '*.jpg'\ | |
| while read x; do\ | |
echo mv \"$x\" \"$(exif --tag='Date and Time (Original)' -m "$x" | sed -e 's/:/-/g' -e 's/ /_/')_${x#./}\"; done >foo | |
# try one line first | |
awk NR==1 foo | sh -v | |
# maybe first 100 | |
awk 'NR>1 && NR<=100' foo | sh -v | |
# whack | |
awk 'NR>100' foo | sh -v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment