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
Yes.
what does the syntax look like? can you provide an example?
thanks again
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
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
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
that worked! ;D
thank you for your quick help but most of all... thank you for the AWESOME tool!!!
truly a masterpiece
for the write... is it possible to include unique dates for each entry in the text file?
thanks again!
Yes. For this you should look at the -csv option.
- Phil
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
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!
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
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
There is no limit.
- Phil
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!
It should work fine with just one line in the -@ argfile. There must be something else going on. Post your full command and the argfile and we'll try to help.
- Phil
Quotecommand:
exiftool -UserComment -DateTimeOriginal -GPSPosition -@ list.txt
list.txt:
C:\Users\Smith\Desktop\New folder1\IMG_3799.jpg
if i add another entry to list.txt i get output but i dont get anything with just one entry.
thanks!
I can't see anything wrong, but you didn't attach the list.txt file and some hidden characters may be significant.
I tried it with no extra characters in list.txt (ie. no leading UTF-8 BOM and no linefeed at the end of the line), and it worked fine.
I would like to find the reason for this, but a work-around may be to add a blank line to the file.
- Phil
i dont see any hidden characters or extra spaces
i tried adding an extra few blank lines - still nothing (no error no output)
using current version of exiftool 10.2.5
thanks for your help
I can't reproduce this problem. I just tried it with your list.txt file and got this (on Windows 10 with ExifTool 10.25):
"File not found: C:/Users/GXM/Desktop/New folder1/IMG_3799.jpg"
And it worked fine when I changed the file to one that existed.
So I have no idea why this doesn't work for you. Your file had no extra hidden characters. There must be something else going on here.
But maybe try my idea of adding a blank line to the .txt file
- Phil
i tried adding a blank line.. even a few.. still no luck =/
running windows 7 64bit
This makes absolutely no sense. I can see no way that a single file in the -@ argfile could ever be ignored. Maybe try adding -v to the command line to see if there are any messages that could yield a clue.
- Phil
Edit: Oh, wait. There will be no output for a single input file if the tags don't exist. And ExifTool only gives the "### image files read" message if there was more than one file specified. This must be what you are seeing. Try it on a file where these tags exist. This is the same behaviour if the files are specified on the command line, and has nothing to do with the -@ option.
that worked =)
i guess i expected something different because if you run 2 files where the tags don't exist you still get an output: each of the file paths
to be consistent, would it be easy to incorporate that?
nice catch!
A majority of the time people run exiftool on a single file, and for this case the extra messages are superfluous, so reducing clutter trumps consistency in this case.
Maybe the -progress option will give you what you want?
- Phil
yes i think so, i just have to parse out the [#/#] somehow with stringregexp or something
thanks for all your help