ExifTool Forum

ExifTool => Newbies => Topic started by: GeorgeReis on June 21, 2012, 01:09:36 PM

Title: Exporting specific tags to text file
Post by: GeorgeReis on June 21, 2012, 01:09:36 PM
I want to create a text file that has only specific tags written to it, for instance maybe image height and image width. I looked up the tag names and find that they are "ImageHeight" and "ImageWidth." I thought I could write exiftool -ImageHeight -ImageWidth > jpgfile > textfile and that I would end up with a text file with those two data fields. Instead, I get a message in my terminal window stating, "No file specified" and the text file has no data. Can someone tell me what I'm doing wrong?
Title: Re: Exporting specific tags to text file
Post by: Phil Harvey on June 21, 2012, 01:21:49 PM
Try this:

1) Type "exiftool -w txt -imageheight -imagewidth" followed by a SPACE in a Windows cmd.exe or OS X Terminal window.

2) Drag and drop any image file onto the window (it should type the file name for you)

3) Press RETURN

You should then get a ".txt" file with the same name as the image file in the same folder.

- Phil
Title: Re: Exporting specific tags to text file
Post by: GeorgeReis on June 21, 2012, 01:51:39 PM
Excellent - this worked perfectly!

Now, suppose that I wanted to batch process. It seems that I may want to process all files in a folder and get separate files for each; or, I may want to process all files in a folder and get a single file. Are either or both of these possible?
Title: Re: Exporting specific tags to text file
Post by: Phil Harvey on June 21, 2012, 02:02:24 PM
I may want to process all files in a folder and get separate files for each;

Try the above technique, but drop one or more folders instead of a file.

Quote
or, I may want to process all files in a folder and get a single file

That is where the output redirection comes in:

1) Type "exiftool -imageheight -imagewidth" followed by a SPACE

2) Drop files and/or folders onto the terminal window (add spaces between if necessary)

3) Type " > out.txt" then press RETURN in the terminal window

You will now have a file called "out.txt" in the same directory as reported by the "pwd" command in the terminal.

Adding the -r option to either command will also process images in folders inside these folders, etc, recursively.

- Phil