ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Happy Hobo on December 29, 2023, 03:09:14 AM

Title: Writing tags from CSV file
Post by: Happy Hobo on December 29, 2023, 03:09:14 AM
Today, I'm working on 75 pictures that I took with an iPhone 4s long ago.  Several of them have no lat/long and several taken at different DateTimeOriginal have identical GPSDateTime.  These subsets overlap but aren't identical.

I created a CSV file, opened it in a spreadsheet, and corrected the GPSDateTimes by adding the time zone offset.  I looked at the images missing lat/long and recognized the location, so I added that.  So the spreadsheet (which I can save as CSV) has columns headed SourceFile,Lat,Long,GPSDateTime.  I can edit that into a script, but I wonder whether there is a way to update those tags directly from the CSV?
Title: Re: Writing tags from CSV file
Post by: Phil Harvey on December 29, 2023, 07:49:43 AM
See FAQ 26 (https://exiftool.org/faq.html#Q26).

- Phil
Title: Re: Writing tags from CSV file
Post by: StarGeek on December 29, 2023, 09:17:03 AM
Quote from: Happy Hobo on December 29, 2023, 03:09:14 AMSo the spreadsheet (which I can save as CSV) has columns headed SourceFile,Lat,Long,GPSDateTime.

If the headers are actually "Lat" and "Long", then you will have to change them to GPSLatitude/GPSLongitude.  Also, you will have to duplicate the columns and change the headers for the duplicates to GPSLatitudeRef/GPSLongitudeRef.  There is no need to change the values in these columns to E/W/N/S, as exiftool will apply the correct values based upon if the coordinate is negative or positive.

Alternatively, you can add a new column to combine the two columns with a comma separating the two values and use GPSPosition as the header. Something like this I think
=A2&","&B2
In this case you don't need to rename the "Lat" and "Long" columns, exiftool will ignore them.  With GPSPosition, exiftool will write both the GPS coordinate tags and the reference tags.
Title: Re: Writing tags from CSV file
Post by: Happy Hobo on March 26, 2024, 11:14:23 PM
That and FAQ 25 gives me a great answer; thanks.
They're "lat" and "lon" only because I changed them for input to another tool.  But the corrections need to be made before feeding the other tool, so I can just do that and then
run the other tool.