Last active
May 4, 2018 21:24
-
-
Save paolobenve/f45702fd14aaf62d23f9fcdda9bd7fe7 to your computer and use it in GitHub Desktop.
A simple script that renames an .ARW raw file and its corresponding .xmp file according to exif date
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
#!/bin/bash | |
name=$1 | |
shift | |
for i | |
do | |
file="$i" | |
date=$(exiv2 -g Exif.Photo.DateTimeOriginal pr "$file" | cut -c61-79) | |
date=${date:0:4}-${date:5:2}-${date:8:2}--${date:11:2}.${date:14:2}.${date:17:2} | |
echo mv "$file" "$name $date".ARW | |
mv "$file" "$name $date".ARW | |
echo mv "$file".xmp "$name $date".ARW.xmp | |
mv "$file".xmp "$name $date".ARW.xmp | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment