querying/writing tag to a list of files (batch processing)

Started by gcue, April 19, 2016, 09:48:07 AM

Previous topic - Next topic

gcue

hello

is it possible to write or query a tag to a list of files.. perhaps specified through a text file?

thank you in advance

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gcue

what does the syntax look like?  can you provide an example?

thanks again

Phil Harvey

You'll have to narrow things down a bit.  Your question is too vague.  Do you want to read or write?  What tags?  What format text file?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gcue

sorry about being vague.. :-[

i am trying to read the DateTimeOriginal tag for several thousand files.  i am going to output the file paths to a text file.  so each line would look something like this..

c:\users\smith\desktop\folder\file1.jpg
c:\users\smith\desktop\folder\folder2\file1.jpg
c:\users\jones\desktop\folder\folder7\file1.jpg

i would also like to be able to write the same tag to multiple files as well.

please let me know if i need to specify anything else

thanks again


Phil Harvey

So you want to read DateTimeOriginal for all files listed in a text file?  This command will do it:

exiftool -datetimeoriginal -@ file_list.txt

and to write instead of read:

exiftool "-datetimeoriginal=2016:04:19 13:29:00" -@ file_list.txt"

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gcue

that worked!  ;D

thank you for your quick help but most of all... thank you for the AWESOME tool!!!

truly a masterpiece

gcue

for the write... is it possible to include unique dates for each entry in the text file?

thanks again!

Phil Harvey

Yes.  For this you should look at the -csv option.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gcue

So glad it can do it. What is the syntax like?  Is it the same as the text file command?  Csv file... first column file path, second column tag and third date/time?

Thank you again for your help

gcue

found an example in the forum =)

csv
QuoteSourceFile,DateTimeOriginal
C:\Users\Smith\Desktop\New folder1\IMG_0066.JPG,2016:03:07 10:29:00
C:\Users\Smith\Desktop\New folder1\IMG_3894 (1).JPG,2016:03:07 10:20:01

command i am using
exiftool -csv="C:\Users\Smith\Desktop\tags.csv" -r "C:\Users\Smith\Desktop\New folder1"

i am curious why this is needed
-r "C:\Users\Smith\Desktop\New folder1"

since the location of each file is already specified in the SourceFile column?

thanks again!

Phil Harvey

Quote from: gcue on April 25, 2016, 12:25:12 PM
since the location of each file is already specified in the SourceFile column?

Because you specify the files to process on the ExifTool command line for all other types of commands, and I thought it would be confusing to make this different.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gcue

gotcha ... consistency is good =)

is there a limit with how many files are processed through the txt or csv file?

thanks again for sharing such a powerful program

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gcue

i think i may have found a bug?

if the file_list.txt for the -@ switch happens to have only 1 file path it doesn't work

no output or error

i would think it should work because sometimes it's unpredictable how many file paths we can expect there to be in the text file if the text file is generated through a script process

thanks!