Main Menu

Tags from Text File?

Started by ManorMan, May 20, 2018, 01:07:36 PM

Previous topic - Next topic

ManorMan

What I'm trying to achieve is the following

exiftool -tagsFromFile tagsfile.txt image.jpg

TAGSFILE.TXT
XPTitle="Title here"
XPSubject="Subject here"
XPComment="Comments here"

I'm aware -tagsFromFile is from pulling existing tags from an image. Is there a way I haven't found to apply specific tags to an image from a text file?

Help massively appreciated!


ManorMan

While I'm not sure its possible within ExifTool, I've found the following line in a batch file works for anyone struggling with the same issue

for /F "tokens=*" %%A in (tagsfile.txt) do exiftool.exe %%A image.jpg

tagfile.txt is the same structure as in OP.

StarGeek

You can't user -TagsFromFile to pull tags from a text file, but you can the text file to directly write the tags using the -@ option

Just change your text file so that it has the actual commands, one per line, without the quotes, like this:
-XPTitle=Title here
-XPSubject=Subject here
-XPComment=Comments here


and then call it with a command like this:
exiftool -@ /path/to/TAGSFILE.TXT FileOrDir
"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

StarGeek

It's going to be much slower to run exiftool in a loop like your second post.  That's Common Mistake #3.  The startup time is exiftool's biggest performance hit and if you run it individually on hundreds or thousands of files, it'll take much longer than running it once like my example.
"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

ManorMan

Yeah, that's significantly better. Thanks StarGeek.