Exporting metadat to XML/TXT single file

Started by lmatias, February 02, 2011, 12:58:50 PM

Previous topic - Next topic

lmatias

Hi everyone
I'm a newbie with ExifTool and would apreciate your help on the following problem.
I need to extract metadata from a large number of files (NEF and JPG) to a single XML file or a TXT file to process in a database.
Is this possible to do with ExifTool?
One example is to extract FileName; Orientation; DateTimeOriginal; FocalLenght and FocalLenght35mm to a single XML file with TAGs and/or TXT file with Comma Separated Values (first line with Tag names, CSV too)
I already tried the command lines:
exiftool -T -k  -aperture -createdate -shutterspeed -iso f:\Guida\*.jpg > out.txt
and
exiftool -T -k  -aperture -createdate -shutterspeed -iso f:\Guida\*.jpg > f:\Guida\out.txt

and the files are processed but the error messages:
"Error opening directory"
"File not found: out.txt"

are always displayed.

To the XML format I don't know how the command line is. If that is possible...

Thanks

Phil Harvey

The command for XML output is

exiftool -X DIR > out.xml

I don't understand why you are getting the errors.  What system are you using?

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

lmatias

I'm using Windows XP Professional SP3

When you say DIR it means the full path to the directory where the image files are, wright?
If we don't indicate no path on the "out.txt"  or "out.xml" where is the file placed?

With the command line
exiftool -T -k  -aperture -createdate -shutterspeed -iso D:/Arquivo/Fotos > D:/Arquivo/Fotos/out.txt

I obtain the result I append for six example .jpg files

Thanks
Luis

Phil Harvey

Hi Luis,

Directories and file names may be specified either with a full path, or relative to the current working directory.  When you don't specify a directory for a file, it is placed in the current working directory (which you can see by typing "pwd" at the command line).

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

lmatias

Hello Phil

About the error I get can you help me?
What am I doing wrongly?
I have the exiftool.exe file on the Windows directory.
I will try in another computer also but only later at night.

Ciao
Luis

Phil Harvey

Hi Luis,

About the error:  It looks like either you are putting quotes around the redirection symbol (">"), which would be wrong, or you are not using an ASCII greater-than symbol.  If you have an international keyword, could it be that you are using some similar-looking character?

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

lmatias

Hello Phil

I discouvered what I was doing wrong.
I was running the command line to Exiftool with Windows Execute (from the Start Menu).
I opened a DOS/Command window and the Exiftool command line worked immediately.

So thanks. I'm ready to do hat I need with your software.

Kindely
Luis Matias

Phil Harvey

Hi Luis,

I'm glad you figured this out because I wouldn't have thought of this.  It is the cmd shell that does the redirection, so this makes sense.  If you run directly from the "Run..." menu you bypass the cmd processor.

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

Bluegum

I seem to be having a similar problem with a Windows shortcut (Windows 7 Enterprise). 

The target I am using is C:\Users\me\exiftool-8.75\exiftool.exe -a -csv *.jpg > out.csv which works fine from a command prompt, but with the windows shortcut the redirect > seems to be interpreted as a parameter, giving the error message Error opening directory >.

Can you confirm that the problem is with the cmd processor (or lack of), or am I missing something?

Nick

Phil Harvey

Hi Nick,

You can't use special shell characters like ">" in a shortcut.

Instead, make a simple .bat file:

C:\Users\me\exiftool-8.75\exiftool.exe -a -csv %* > out.csv

Then drop the JPEG images on this .bat file.

I notice that you put "*.jpg" in your shortcut target.  This also won't work.  Above I assumed you want to drop the files on the .bat file, but if you don't then replace "%*" with "*.jpg".  If you do this, then clicking on the .bat file will run exiftool on a JPG files in the working directory (your home directory by default?).  I think you can set the working directory in the Properties of the .bat file if you want.  Also, "out.csv" will be created in the working directory unless you add a directory to the name.

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

Bluegum

Thanks Phil,

I'd started going down the batch path and with your suggestions have got a more flexible result that does what I want ie provide a list of tags I can use to help eliminate duplicate files in our 100,000+ photo library.

Still a long way to go though  :D

Thanks again.

Nick