ExifTool Forum

ExifTool => Newbies => Topic started by: Newsky on July 20, 2017, 02:23:42 AM

Title: XPSubject from txt file
Post by: Newsky on July 20, 2017, 02:23:42 AM
Hello. Please tell me how you can add data from a text file in the XPSubject?
Title: Re: XPSubject from txt file
Post by: Stephen Marsh on July 20, 2017, 05:41:53 AM
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).
Title: Re: XPSubject from txt file
Post by: Phil Harvey on July 20, 2017, 06:57:08 AM
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
Title: Re: XPSubject from txt file
Post by: Newsky on July 21, 2017, 01:02:35 AM
Thank you, Thank you very much, Phil! It turns out so simple! And I have not tried what variants