Skip to content

Instantly share code, notes, and snippets.

@paolobenve
Last active May 4, 2018 21:24
Show Gist options
  • Save paolobenve/f45702fd14aaf62d23f9fcdda9bd7fe7 to your computer and use it in GitHub Desktop.
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
#!/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