ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: george013 on July 28, 2019, 06:19:33 AM

Title: output list
Post by: george013 on July 28, 2019, 06:19:33 AM
I couldn't find an answer here so this post.
I try to get a list of used keywords. I used the basic exiftool -keywords *.* for that. All keywords where written to screen correct.
Trying to get those words written to a file I tried the following.

exiftool -keywords *.* >key.txt
unknown file type -key.txt

exiftool -keywords *.* > key.txt    ..a space added after >
unknown file type -key.txt

exiftool -keywords *.* > key.csv
unknown file type key.csv
unknown file type key.txt  ????????

exiftool -keywords *.* > key.txt
unknown file type key.csv ???????
unknown file type key.txt

The above are written in chronological sequence.
First: why do I get 'unknown file type'.
Second: why does it remember a former command?
Third: why do I get smiley's when I didn't add them?. Seems 3 times ? gives a smiley.

Thanks.

George
Title: Re: output list
Post by: Hayo Baan on July 28, 2019, 06:37:47 AM
Since you use *.* ALL files in the directory will be used, this will include the key.txt (and key.csv) file that you just asked exiftool to generate (which themselves are unknown file types to exiftool). Remove those and generate the output in a separate directory to prevent the warnings :)
(actually you already have what you want in both key.csv and key.txt, but above explains what you see)


And yes, three times a ? gives a ??? just like : followed by ) gives a :)
Title: Re: output list
Post by: george013 on July 28, 2019, 06:41:06 AM
I think I found the answer.
The output file is first written to that directory and when working on *.* it's read to. That's why it 'remembers' the other output file, it was on the disk already.
"unknown file type" is meant for the input file, not for the output file. :-\.

I see Hayo has posted this just now.

George
Title: Re: output list
Post by: george013 on July 28, 2019, 07:25:57 AM
*.nef solved it. Thanks.


Title: Re: output list
Post by: george013 on July 30, 2019, 01:41:14 PM
Another example I can't explain.
exiftool -keywords v:\d750  works with all the file in the mentioned directory.

exiftool -keywords v:\d750 -r works with all the files in the mentioned directory and with all it's subdirectories.

exiftool -keyword v:\d750\*.nef works as expected too.
exiftool -keyword v:\d750\*.nef -r doesn't work recursive. It looks like it can't see the difference between a file and a directory.

In a Pascal program I just read over 60000 records extracting keywords, aperture and shutterspeed. It took about 33 minutes. That's about 30 files per second. Is that a fair speed?

George
Title: Re: output list
Post by: StarGeek on July 30, 2019, 01:54:58 PM
Make sure you read the docs on the -r option (https://exiftool.org/exiftool_pod.html#r-.--recurse).

   Recursively process files in subdirectories. Only meaningful if FILE is a directory name.

What you want to use instead of *.nef is the -ext (extension) option (https://exiftool.org/exiftool_pod.html#ext-EXT---ext-EXT--extension), e.g. -ext nef
Title: Re: output list
Post by: george013 on August 04, 2019, 08:53:36 AM
Excuse me for asking more.
I learned from another thread here I could use a tab form output. Selecting that -T and only keywords gives me an output with only the keywords, no filenames and comments. That's ok. But also the images with no keywords are send to the output file. I'm trying to use something as if -keyword ne empty. I just can't find info on how to write that in this script.

My goal is to create a list of used keywords, just that. Exiftool can give me a list with the used keywords per image. Later I've to extract the individual keywords and add them to a list/database only once a time, so unique. I don't think this can be done with Exiftool.

George
Title: Re: output list
Post by: Hayo Baan on August 04, 2019, 09:31:50 AM
No need to be fancy in this case. -if '$keywords' should be enough (on Windows, change single quotes into double quotes).
Title: Re: output list
Post by: george013 on August 04, 2019, 10:51:12 AM
Thanks. That worked.

George
Title: Re: output list
Post by: george013 on August 06, 2019, 09:49:50 AM
When reading the output list I noticed that after the first keyword a leading blank is added to the next keywords. Is there a way to avoid that? Or is a combination of comma+blank used as a delimiter?

I just keep asking  ;D

George
Title: Re: output list
Post by: Hayo Baan on August 06, 2019, 11:04:49 AM
Yep, that's the default. However, you can specify the output separator to be used with -sep. E.g. to have a comma without space, use -sep "," :D
(quotes in this case aren't even necessary, but added for clarity)