date and city in filename

Started by janutz, April 17, 2010, 09:17:21 AM

Previous topic - Next topic

janutz

At the moment I use this command in a batch file to set the date in the filename of all jpg-files in the directory:
exiftool "-FileName<${CreateDate}_%%f.%%e" -d "%%Y%%m%%d_%%H%%M%%S%%%%-c" *.JPG

Now I want to have also the city of the IPTC tag in the file name in the form date_city_filename.jpg.
Is this possible?

-Jan

Phil Harvey

Hi Jan,

Yes.  It is as simple as adding "${city}" to the string you are copying"

exiftool "-FileName<${CreateDate}_${city}_%%f.%%e" -d "%%Y%%m%%d_%%H%%M%%S%%%%-c" *.jpg

- 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 ($).

janutz

Hi Phil,

Thank you very much for the quick response.

-Jan