News:

2023-08-10 - ExifTool version 12.65 released

Main Menu

Batch create txt

Started by Ruriko, October 15, 2016, 02:27:35 AM

Previous topic - Next topic

Ruriko

I have a folder with a bunch of sub folders and in each sub folder contain thousands of images. I want to create a txt file that get all the image keywords and comments. This is the command I use
exiftool -T -r -filename -exif:XPComment -exif:XPKeywords "C:\Users\Administrator\Downloads\anime" > anime.txt
Right now that command only does it for that particular folder but I want it auto create txt info for each folder. Is there a batch method?

Phil Harvey

Sure, try this:

1. cd c:

2. cd \Users\Administrator\Downloads\

3. exiftool -T -r -filename -exif:XPComment -exif:XPKeywords -w+ %-.1d.txt .

If the subdirectories have subdirectories, then the .txt file is created inside the subdirectory.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Ruriko


andreap

I actually have the same question, and I haven't managed to translate Ruriko's solution into my own (note - I'm medium-low on command-line savvy).

I am trying to check certain TIFF file specifications for preservation images in an archive. I am using a Mac system and pulling data from a networked drive. The following works just fine for pulling an individual folder:

exiftool -T -FileName -BitsPerSample -FileSize -FileType -ProfileDescription -Directory /Volumes/digitalimgshare/1_PROJECT_FOLDER_dis1/[projectname]/19_URLs_sent_to_metadata/[itemfolder]/Originals/ > test.txt

However, my attempts to pull data for everything at the /Volumes/digitalimgshare/1_PROJECT_FOLDER_dis1/[projectname]/19_URLs_sent_to_metadata/ level has been unsuccessful.

Caveat: There are both .tif and .jpeg derivatives in separate sub-sub folders within that directory, as well as a few other scattered .txt and .pdf files related to the project. Does this mixture pose a problem beyond having unintended lines of data in my final spreadsheet?

Hayo Baan

If you only want to process tiff files, add -ext tif to your command.
Hayo Baan – Photography
Web: www.hayobaan.nl

andreap

#5
That will be helpful! However, I think I worded my request poorly. I'm getting an error saying "file not specified" when I try to approximate the

exiftool -T -r -filename -exif:XPComment -exif:XPKeywords -w+ %-.1d.txt

command supplied to Ruriko above, tailored to my own request. So, I am unable to get any results period. I expect I am probably misunderstanding those commands and translating them into gibberish of some kind.

Phil Harvey

You are just missing a directory name at the end of the command.   In my example, the directory was ".", which is the current working directory.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

andreap

Thank you for the response! The following is what I am attempting to push through the system, and still getting the File not found error

exiftool -T -FileName -BitsPerSample -FileSize -FileType -ProfileDescription -Directory -w+ %-.1d.txt Volumes/digitalimgshare/1_PROJECT_FOLDER_dis1/[projectname]/19_URLs_sent_to_metadata/

Phil Harvey

Instead of typing the directory name, try dragging and dropping the folder.  Be sure to put a SPACE on the command line before dropping the folder.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

andreap

Excellent! It looks like I was missing a slash.

For the benefit of anyone checking this thread, I modified the .txt to create a single .txt file. This is really handy for doing quality control on large volumes of images that have to meet specific criteria for archival standards - in this case, bit depth, file type, and color profile (though some other info was added for reference). In hind sight, the file type is redundant since it's set up to only pull data from TIFFs. Note, this will create the .txt in the folder from which you ran the command, not automatically in the path from which you are gathering the data:

exiftool -T -r -ext tif -FileName -BitsPerSample -FileSize -FileType -ProfileDescription -Directory -w+ %0ftest.txt /directory/

I like this. I like it very much.

-Andrea