Skip to content

Instantly share code, notes, and snippets.

@paolobenve
paolobenve / date rename ARW and xmp
Last active May 4, 2018 21:24
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
@paolobenve
paolobenve / rename-ARW-and-xmp-with-date
Last active May 16, 2018 09:25
a simple script that reads exif date from arw files and renames them and the corresponding xmp using the given name and the date
#!/bin/bash
# first argument: the main part of the new name
# following arguments: the *.ARW files you want to rename
#
# example:
# $ rename-ARW-and-xmp-with-date "new name" DSC02*.ARW
name=$1
shift