Quote from: Emeline on June 03, 2022, 01:40:48 AMWhen I use the following exiftool code and then CamTrapR, my species column is not correct for folders with count subfolders, the species being the number of individuals instead.
exiftool "-HierarchicalSubject<Species|${directory;my @a=split m(/);$_=$a[-2]};Count|${directory;my @a=split m(/);$_=$a[-1]}" -r -overwrite_original -P -ext JPG "E:\Other"
Using your example path, this creates a single
HierarchicalSubject entry with the value of
Species|Long-tailed macaque;Count|1when what I think you want is two entries with the values of
Species|Long-tailed macaqueCount|1If that's the case, you need to add the
-sep option (https://exiftool.org/exiftool_pod.html#sep-STR--separator), specifically
-sep ; so exiftool knows to separate the list on the semicolon character. See also FAQ #17 (https://exiftool.org/faq.html#Q17).
Try
exiftool -sep ; "-HierarchicalSubject<Species|${directory;my @a=split m(/);$_=$a[-2]};Count|${directory;my @a=split m(/);$_=$a[-1]}" -r -overwrite_original -P -ext JPG "E:\Other"QuoteI tried this code:
exiftool "-Species<${directory;my @a=split m(/);$_=$a[-2]}"-r -overwrite_original -P -ext JPG "E:\Other"
When you run that, you should get this warning
Warning: Tag 'species' is not definedThat's because this "tag" doesn't exist. You can't just make up a tag name and expect exiftool to know how to write it. To create your own tag, take a look at the
example.config file (https://raw.githubusercontent.com/exiftool/exiftool/master/config_files/example.config).
QuoteDo I need to create a new tag or is there already a species tag that exist that I could modify ?
If you want a "Species" tag, then yes, you have to create one. But I recommend against it, as no program other than exiftool is going to be able to read that tag.
Technically, you probably want to look at the Darwin Core (https://exiftool.org/TagNames/DarwinCore.html) tags, as they are meant to "facilitate the sharing of information about biological diversity". See the Darwin Core standard (https://www.tdwg.org/standards/dwc/) for details.
But the Darwin Core standard doesn't have much support outside of programs specifically designed for it. So you still might end up not having easy access to the data.
My suggestion would be to continue using
HierarchicalSubject as it is readily supported by most programs and look into the Darwin Core as a long-term goal.
I know that there are several people in these forums who are more familiar with the Darwin Core and use it regularly. Hopefully one of them will chime in.