#!/bin/bash



exiftool DJI_*.JPG | grep -e 'File Name' -e 'Latitude      ' -e 'Longitude       ' > tmp1
sed -n '1,${p;n;n}' tmp1 > fns
sed -n '2,${p;n;n}' tmp1 > lts
sed -n '3,${p;n;n}' tmp1 > lns

awk '{print $4, $6, $7}' lts | sed "s/'//g;s/\"//g" | awk '{print $1+$2/60+$3/3600}' > ltsn
awk '{print $4, $6, $7}' lns | sed "s/'//g;s/\"//g" | awk '{print $1+$2/60+$3/3600}' > lnsn
awk '{print "\"" $4 "\""}' fns > fnsn

paste -d',' fnsn ltsn lnsn > data1.csv

rm tmp1 fns lts lns fnsn ltsn lnsn
