add keywords to jpg image from list off txt files

Started by foler, November 17, 2022, 09:23:41 AM

Previous topic - Next topic

foler

hi
i have jpg images, one.jpg two.jpg etc.
i have txt files with keywords one.txt two.txt etc...

how to use exiftool to add this keywords from txt files into tags field in jpg images?


StarGeek

Is it a separate text file for each image?  How are the keywords separated within the text file?

The tag you want to write to is the XMP:Subject tag, though IPTC:Keywords can also be used. See this post for all the tags that Windows reads. The latter is an older standard and I suggest writing to the first on unless you need the IPTC one.

If each image has a separate text file, then you would use the -TAG<=DATFILE option to write the data from the file into the image.  You would also have to include the -sep option so you get separate keywords rather than a single long keyword.

The command for this would look like this
exiftool -sep "YourSeparator" -ext jpg "-Subject<=%d%f.txt" /path/to/files/

Anything else would require a lot more information on how your data is structured.
"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

foler

data in folder is like, yes each file own txt file:
shutterstock_12345678.jpg
shutterstock_12345678.txt (file with keywords. keywords separated with commas as long sentence)

this command work
exiftool -ext jpg "-Subject<=%d%f.txt" C:\c\c

is it possible to add same tags into eps files?
is it possible to not duplicate original file? (_original)

Phil Harvey

Quote from: foler on November 21, 2022, 03:51:06 AMis it possible to add same tags into eps files?

Yes.

Quoteis it possible to not duplicate original file? (_original)

Yes, by adding -overwrite_original to the command.  But if you are writing EPS files you should test to be sure your applications can read the edited files before deleting the originals.

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