Use of Exiftool's ADVANCED Option -echo with and without an ARGFILE

Started by JoshInDC, October 18, 2022, 11:35:49 AM

Previous topic - Next topic

JoshInDC

I am writing metadata to thousands of PDF files on Windows 10. I have written a standard slow script that calls exiftool for every PDF, but of course this is veeerrryyyyy slow. I have also figured out how to use the ARGFILE to do the metadata writing MUCH faster, but I am trying to keep a log, so if I get an error, I can know what filename is causing the error, or what file was missing...

For example, in Dos, I can run the following command:

    exiftool -echo 000089 -WHT-ID=000089 000089.pdf


And I get back:

    000089
        1 image files updated


This is as I would expect.


Then I run the same and dump the results to a text file using the following command:

    exiftool -echo 000089 -WHT-ID=000089 000089.pdf >> _out.txt


And I get a good result in the _out.txt file (showing my ID, and the result of exiftool):

    000089
        1 image files updated


Then I run a cmd on a non-existant file and dump the results to a text file using the following command:

    exiftool -echo 000090 -WHT-ID=000090 000090.pdf >> _out.txt


And I get a nice error message in the _out.txt file as desired...

    000090
        0 image files updated
        1 files weren't updated due to errors


WONDERFUL! Thus far everything works as I would expect. I am receiving nice messages, either of success, or of errors, due to missing files, in this case, or hopefully failures writing metadata...



BUT when I try to do this using the ARGFILE method (so it will be much much faster), it is not working as desired. Perhaps I am not doing things correctly, but it seems that -echo is now being treated as a tag, and not an ADVANCED option.

Here is what my ARGFILE looks like (would normally have thousands of more lines):

    -echo 000089
    -WHT-ID=000089
    000089.pdf
    -execute


And here is how I call it in DOS, trying to get a log of the exiftool actions:

    exiftool -@ _meta.txt >> _out.txt


But this is what it spits out on the command line:

    Invalid TAG name: "echo 000089"
    Ignored superfluous tag name or invalid option: -echo 000089


And this is what the _out.txt file now has (since the -WHT-ID metadata write was successful), but unfortunately, the ID is not echo'd to this file, which is what I would like:

    1 image files updated



SO, it seem that now the ADVANCED option -echo is now being seen as a standard metadata tag, and exiftool is trying to write it to my file, but what I really want is to just output the ID to the _out.txt file along with the result of exiftool's actions, so I can have a log of failures and successes.

What can I do to get this to work correctly. It seems that -echo is no longer recognized when it comes from an ARGFILE...

Thanks! And thanks again for a great tool in Exiftool!



StarGeek

See FAQ #29.  The -echo option and the text it outputs are two separate arguments and need to be on separate lines.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

JoshInDC

Thanks much! It worked just fine when I set up a given ARGFILE record like this:

-echo
000089
-WHT-ID=000089
000089.pdf
-execute

Notice the -echo on one line, and then the text that I wanted to print on the next line.
(In this case, 000089)

Phil Harvey

Cudos to StarGeek for sorting through such a long TL;DR to find the simple problem. :)

- 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 ($).

StarGeek

Quote from: Phil Harvey on October 19, 2022, 03:41:52 PMCudos to StarGeek for sorting through such a long TL;DR to find the simple problem. :)

Actually, I read the title, jumped to the conclusion it was FAQ #29, and hit control+F to find the -echo statement to verify.

The cudos are that I took the extra step to verify :D
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

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 ($).

JoshInDC

Haha TL;DR!

Part of the reason why I wrote everything out was so that the other newbies would be able to search and find this solution. I had done some googling and couldn't find an answer, so I hoped the next noob would just find this thread and not have to ask!

Thanks again...