XPSubject from txt file

Started by Newsky, July 20, 2017, 02:23:42 AM

Previous topic - Next topic

Newsky

Hello. Please tell me how you can add data from a text file in the XPSubject?
Sorry for my english. I use Google translator

Stephen Marsh

One method... You can export/output a .csv file in order to find out the image paths and or tags:

exiftool -r -a -G1 -s -csv '/PATH_to_SOURCE_DIR' > '/PATH_to_OUTPUT/OUTFILE.csv'

Then you can build your input file .csv file, such as:

SourceFile,XPSubject
/PATH_to_IMAGE_DIRECTORY/1.jpg,xpsubect-one
/PATH_to_IMAGE_DIRECTORY/2.jpg,xpsubect-two
/PATH_to_IMAGE_DIRECTORY/3.jpg,xpsubect-three


Finally, you can then import:

exiftool -r -sep "," -csv='/PATH_to_CSV/input.csv' '/PATH_to_IMAGE_DIRECTORY'

If the file is a tab delimited text file, then the command would be simpler.

Swap the single straight quote marks for double straight quote marks if on MS Windows (only required if there are word spaces in the path).

Phil Harvey

Or if you want to simply copy the contents of a file to the value of a tag, you can do this:

exiftool "-xpsubject<=some_file.txt" FILE

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

Newsky

Thank you, Thank you very much, Phil! It turns out so simple! And I have not tried what variants
Sorry for my english. I use Google translator