i've found the topic on using command to print directory as below
exiftool -p "${directory;s(.*/)()}" "c:/photostore/photos/2011/2011-01" -r
which gets me "2011-01"
I'd like to incorporate the directory split into a csv output with several other tags.
I've tried to adapt to command but failed.
can anyone help me please?
How about:
exiftool -p "$make,$model,${directory;s(.*/)()}" -r "c:/photostore/photos/2011/2011-01"
Splitting the directory like that can't be used with the -csv option (https://exiftool.org/exiftool_pod.html#csv-CSVFILE), if that was what you were looking to do. You would instead have to create the CSV file using the -n (--printConv) option (https://exiftool.org/exiftool_pod.html#n---printConv) as greybeard shows.
A problem arises if there are commas in the data. FAQ #12 "How do I export information from exiftool to a database?" (https://exiftool.org/faq.html#Q12) gives a way to fix this using the -api Filter option (https://exiftool.org/ExifTool.html#Filter). Look to the end of that FAQ where it says "in a Windows CMD shell/in Mac/Linux"
I generally use the pipe symbol if there is any chance of commas in the data:
exiftool -p "$make|$model|${directory;s(.*/)()}" -r "c:/photostore/photos/2011/2011-01"
thanks both for the speedy and accurate response.
I'm now well on the way to completing my project.