Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ExifTool output file name

Posted on 2014-04-29
6
Medium Priority
?
528 Views
Last Modified: 2014-05-06
Hi,

Does anyone here use ExifTool?

I'm trying to search hundreds of files for the keyword 'Description' and then output the name of a file that contains the keyword.

Executing "exiftool * | grep Description" gives me the line in the file but not the name of the file that contains the line.

Thank you
0
Comment
Question by:DarthElmo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 57

Expert Comment

by:Bill Prew
ID: 40031108
Have you tried something like this:

exiftool * | findstr /i /c:"======" /c:"description"

Open in new window

~bp
0
 

Author Comment

by:DarthElmo
ID: 40032242
Hi Bill,

Thanks for your response. I'm running this on UNIX, so I'm using grep instead of findstr. But the heart of the issue is that by default, the file name and Description are output on two separate lines like the two below.

File Name                       : [Name of file listed here]
Description                     : [a long string here]

ExifTool is very robust and I'm fairly certain there's a way to make ExifTool pass the file name along with the Description line but so far I have been unsuccessful.

Thanks again
0
 
LVL 57

Assisted Solution

by:Bill Prew
Bill Prew earned 1600 total points
ID: 40032617
Okay, have you tried the -csv option?  It will write the output in a CSV file format with one line per file.  You can combine that with selecting the tag names you want such as:

exiftool -s -csv -filename -comment > output.csv

~bp
0
Vim Reference Guide

Vim is a powerful text editor favored by many sysadmins and developers - here are some commands that you'll want to keep in your back pocket!

 

Accepted Solution

by:
DarthElmo earned 0 total points
ID: 40035396
Hi Bill,

Thank you for that recommendation. That would work. I received another recommendation at another site that gives me exactly what I need, though:

exiftool -p '$filename $description' -r -q -q . | awk '{print $1}'

I'll accept both as solutions.

Thanks again.
0
 
LVL 57

Expert Comment

by:Bill Prew
ID: 40035612
Great, glad you got to a working solution.

~bp
0
 

Author Closing Comment

by:DarthElmo
ID: 40043943
This solution came from a recommendation at another site.
0

Featured Post

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question