CSV with coordinates in selfdefined format, delimiter in CSV

Started by Astrophytum, May 12, 2016, 05:22:02 AM

Previous topic - Next topic

Astrophytum

Hello Forum!

Sorry for my bad English, I hope will understand me.

I have many photos with coordinates.
I need this coordinates and the filename in Excel.

So I try the following to get a CSV- file.

exiftool -q -r -t -f -S -n -csv -fileName -GPSLatitude -GPSLongitude "." > filename.csv

I get a CSV with this:
./P4220533.JPG, P4220533.JPG, 36.6751, -111.679601666667

And now I have 2 problems:

1:)
I need an CSV with an ";" as delimiter. Is this possible?


2:)
I need the coordinates in this format:
N36° 40.506'  ;   W111° 40.776'
I know it's possible to format the GPSLongitude and GPSLatidude, but I found not the right Syntax!

I tried for 1houer to find the right syntax, but there is no way...


So I will ask you, can somebody help me with my problem?

Thank you very much for helping,
Astrophytum

Phil Harvey

Try this:

exiftool -echo "Filename;GPSLatitude;GPSLongitude" -p "$filename;${gpslatitude;s/(.*) ([NSEW])$/$2$1/};${gpslongitude;s/(.*) ([NSEW])$/$2$1/}" -c "%d° %.3f'" DIR > filename.csv

The only trick here was moving the N/S/E/W from the end of the coordinate to the start.  This was done using an advanced formatting expression.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Astrophytum

Hello Phil,

thank you for helping! :)

I changed DIR into ".", so I use this:

exiftool -echo "Filename;GPSLatitude;GPSLongitude" -p "$filename;${gpslatitude;s/(.*) ([NSEW])$/$2$1/};${gpslongitude;s/(.*) ([NSEW])$/$2$1/}" -c "%d° %.3f'" "." > filename.csv


Then I get a warning on screen:
Warning: Bad PrintIM date - ./filename_of_photo

But: the file I looked for, was successfully created!

Thank for this great tool and your very quick helping,
Kind Regrads,
Astrophytum

Phil Harvey

You will still see file warnings with this command.  I think the warning you got was "Bad PrintIM data" (not "date"), which you can safely ignore.  Add -q -q to the command if you don't want to see these warnings.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Astrophytum

Hello Phil,

thank you for helping!  :D


Kind Regards,
Astrophytum

Astrophytum

Hello Phil,

today I make a Batch file and insert this, they same as yesterday:

exiftool -q -q -echo "Filename;GPSLatitude;GPSLongitude" -p "$filename;${gpslatitude;s/(.*) ([NSEW])$/$2$1/};${gpslongitude;s/(.*) ([NSEW])$/$2$1/}" -c "%d° %.3f'" "." > Koordinaten_aus_Photos.csv


I get this in the CSV:

P4230878.JPG   N.3f'   W.3f'

On the DOS-Prompt all is working fine.

Well, I have no idea why is not working in Batch file....


Kind Regards,
Astrophytum

ryerman

Windows 10 Home 64 bit, Exiftool v12.61

Astrophytum