Author Topic: date and city in filename  (Read 3008 times)

janutz

  • Newbie
  • *
  • Posts: 2
date and city in filename
« on: April 17, 2010, 09:17:21 AM »
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
Code: [Select]
date_city_filename.jpg.
Is this possible?

-Jan

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16664
    • ExifTool Home Page
Re: date and city in filename
« Reply #1 on: April 18, 2010, 07:40:24 AM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

janutz

  • Newbie
  • *
  • Posts: 2
Re: date and city in filename
« Reply #2 on: April 18, 2010, 02:08:18 PM »
Hi Phil,

Thank you very much for the quick response.

-Jan