Author Topic: Selective use of an argfile based on content?  (Read 1391 times)

Alan Clifford

  • ExifTool Freak
  • *****
  • Posts: 469
    • A selection of Alan Clifford's photographs
Selective use of an argfile based on content?
« on: May 05, 2013, 10:37:42 AM »
What I would like to do is selectively use an argfile based on some content in the argfile. Specifically, it would be on dates and times.

I have in a bash script which loops through photos doing stuff including taking stuff from an argfile

  if [ "${ARGFILE}" ]; then
    exiftool -m -P -@ "${ARGFILE}" "${xmpphoto}" >&2
  fi


I have a directory of photos taken at different scuba dive sites and have created an argfile for each, for example

-overwrite_original_in_place
-event=scuba diving
-countrycode=BB
-mwg:country=Barbados
-mwg:location=Asta Reef, Barbados
-mwg:keywords-=Barbados
-mwg:keywords+=Barbados
-mwg:keywords-=scuba
-mwg:keywords+=scuba
-mwg:keywords-=Asta Reef
-mwg:keywords+=Asta Reef


My idea is that as I know from my dive log when I was at each site I would have a start time and a duration or end time, so I could put the times in the argfile somewhere.  If so, in what format could I put it in?

I've just had a thought as I write this - maybe I could use comments and parse the comments using grep or similar. That's a tad kludgy though.  Or is there a way I could do something with exiftool rather than looping through the argfiles in the script?