Hello everyone!
I ran the following command on a folder containing thousands of pictures and videos:
exiftool -r -all:all= -tagsfromfile @ "-UserComment<Copyright" "DIRECTORY"
The command worked well, for the most par, as the last lines of the output read:
Quote349 directories scanned
3313 image files updated
17 image files unchanged
1 files weren't updated due to errors
My question is simple, is there any to know exactly which files were unchanged or weren't updated, and due to what reason in each file?
Thank you!
Glad to see you made it over here.
Original Superuser post (https://superuser.com/questions/1254707/using-exiftool-for-bulk-operations/1254861?noredirect=1#comment1886313_1254861%5B/url).
Sorry I haven't been quick enough to respond over there.
You should have gotten an error message for each file that wasn't written.
- Phil
Hi StarGeeek,
No worries, and thanks for replying. This issue is quite pressing so I had to maximize my options ;) I hope I'm not being rude.
Without a conclusion whether I should resume this discussion here or there, I'm going to do so in both.
So searching for warning after running the command with -v2, results in 27 matches (putting error or stderr does not yield any useful results).
This does not settle with the overall 14 "problem" files (13 unchanged, 1 wasn't updated due to an error).
Weirdly enough, checking the very files that had the warning the next to them shows that they were updated as expected.
Thanks!
Try searching for "Error" instead.
- Phil
The only line containing the word "error" is the output's very last one:
1 files weren't updated due to errors
Thanks
I don't understand that. There should be one line with "Error" (capital "E") for the file that wasn't written due to an error.
The files that weren't changed will have their original file modification date/time, but this will include the file with the error.
Also, you can add one or more -v options to the command to get more information about what was done to each file, although this may be more than you want.
- Phil
I copied the output in its entirety to Notepad++. The ONLY line containing the word "error" (with or without a capital E) is the aforementioned one.
I ran (is this grammatically correct?) the command with "-v2".
Thanks!
Can't you post the exact command you used as well as its full output? That way we can better see what's going on.
Use redirection to save the output to a file. With over 3,000 files, the command line buffer probably can't hold all the output.
This question has come up in the past, and currently there is no really good solution because the -v output can be much more verbose than necessary. But at least it should give an error if it can't write the file for whatever reason, and if it doesn't that is a bug in ExifTool that needs fixing.
And in the -v output, files that aren't changed should generate a line like this:
Nothing changed in FILE
Perhaps it would be helpful to add new feature to exiftool to make this accounting easier to obtain. But I hate adding new options because there are already too many. However something like this should have the desired effect (this command works on Mac/Linux, but on Windows you would have to install a 'grep' utility):
exiftool -v ARGS | grep -E "(Error|Nothing)"
- Phil
I haven't tested it, but I think on windows you can use FindStr like this
exiftool -v ARGS | FindStr "Error Nothing"
Quote from: Hayo Baan on December 23, 2017, 04:05:24 AM
Can't you post the exact command you used as well as its full output? That way we can better see what's going on.
How do I do that without flooding this thread? The output is incredibly long.
And here is the command:
exiftool -r -v2 -all:all= -tagsfromfile @ "-UserComment<Copyright" "DIRECTORY"
Quote from: StarGeek on December 23, 2017, 10:47:57 AM
Use redirection to save the output to a file. With over 3,000 files, the command line buffer probably can't hold all the output.
How do I do that, please?
Quote from: Phil Harvey on December 23, 2017, 11:20:36 AM
This question has come up in the past, and currently there is no really good solution because the -v output can be much more verbose than necessary. But at least it should give an error if it can't write the file for whatever reason, and if it doesn't that is a bug in ExifTool that needs fixing.
And in the -v output, files that aren't changed should generate a line like this:
Nothing changed in FILE
Perhaps it would be helpful to add new feature to exiftool to make this accounting easier to obtain. But I hate adding new options because there are already too many. However something like this should have the desired effect (this command works on Mac/Linux, but on Windows you would have to install a 'grep' utility):
exiftool -v ARGS | grep -E "(Error|Nothing)"
- Phil
Quote from: StarGeek on December 23, 2017, 04:45:34 PM
I haven't tested it, but I think on windows you can use FindStr like this
exiftool -v ARGS | FindStr "Error Nothing"
I have the options to test both methods as I have access to both operating systems. What should I do?
Thanks!
Quote from: Roy Brian on December 26, 2017, 01:40:22 PM
Quote from: StarGeek on December 23, 2017, 10:47:57 AM
Use redirection to save the output to a file. With over 3,000 files, the command line buffer probably can't hold all the output.
How do I do that, please?
Add something like
>output.txt to the command. This will save the output to output.txt in the current directory and nothing should appear on the screen while the command is running. You can add a full path if you want output.txt to be saved someplace else. This is not something exiftool does, but is part of the underlying OS.
So your command would be something like:
exiftool -r -v2 -all:all= -tagsfromfile @ "-UserComment<Copyright" "DIRECTORY" >output.txtYou could then attach output.txt to a post rather that copy/pasting it to a post.
Hi folks,
You brilliant suggestions were spot on... StarGeek, indeed there was some missing information from the command prompt itself. When redirecting the output to a text file, everything was there, as Phil mentioned: 13 lines with "Nothing changed in..." and a line with an "Error", for the 13 unchanged files and 1 file that wasn't updated due to an error, respectively. I have decided to attach the output just in case you'd like to take a look, but for some reason the forum forbids me from directly attaching the file to this post (although it is well within the size limitations), so here's a link the file.
https://1drv.ms/t/s!AjiZgAbXI9jwlSJY9-CuBkmtuy8T (https://1drv.ms/t/s!AjiZgAbXI9jwlSJY9-CuBkmtuy8T)
Thanks!
Yup. 117000+ lines of output. That would definitely exceed the cmd.exe scrollback buffer limitation.
- Phil
For those of you that have found this topic years later, ExifTool 11.98 has a new -efile option that could have been useful for this. It creates a file containing the names of files with errors and/or unchanged files and/or files that fail the -if condition.
- Phil