Write csv file to image source file location

Started by UASPilot256, February 22, 2021, 01:19:05 PM

Previous topic - Next topic

UASPilot256

Hello,
I have a windows batch file on my desktop pulling exif data from a folder if images "dragged and dropped" on the batch file and writing a csv to the desktop (code snippet below). Is there a way to read the file path or directory from the exif data of the images and direct the csv to save to that same file path? I'm assuming I can utilize the $Directory tag, but not sure how to weave this into the arguments of -csv.

exiftool.exe -k -progress -a -u -csv %* > output.csv

Thanks!

StarGeek

Quote from: UASPilot256 on February 22, 2021, 01:19:05 PM
Is there a way to read the file path or directory from the exif data of the images and direct the csv to save to that same file path?  I'm assuming I can utilize the $Directory tag, but not sure how to weave this into the arguments of -csv.

No, because the part that puts the output into the csv file is part of CMD/PowerShell redirect and doesn't have access to data that exiftool pulls form the file. 

See here for how to get the parts of the path in batch.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).