Problems with -o option

Started by mujer_esponja, October 01, 2010, 11:35:32 AM

Previous topic - Next topic

mujer_esponja

Hello, I am using this command:

exiftool -a -u -g1 -j -k -r -w .json inputDir

And I want to have all the results in my outputDir, but I can`t manage to get it!!
Any help?

Thanks in advance!

Phil Harvey

I think something like -w OUTDIR/%f.json may do what you want.

The -o option is NOT what you want.  It is the output directory when WRITING the image.

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

mujer_esponja

Thank you very much!!!
I am working with Mac now, I tried also with Win and works perfectly also, but is not going to be a 'problem' this %f in Linux???

Anyway, thanks, you helped me!

Phil Harvey

Percent characters in command-line arguments should not be a problem in Linux.  But if you want to be safe you can always put quotes around the argument.

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

mujer_esponja

Hello Phil, thanks indeed for your answers.
Actually I am not having problems executing this command in the terminal, nor in Mac, Win or Linux, but I am programming in Java and executing this command from a project, it is no generating any file even checking paths or any other thing. My piece of code is:

String process = "exiftool -a -u -g1 -j -k -r -w "+ outDir +"%f.json " + inDir;

Do you know why?
Thanks in advance

Phil Harvey

I don't know Java, but you definitely need to add quotes around "outDir" in the command line in case it contains spaces or other special characters.  Also, you need a space in front of "%f.json" or it will become part of "outDir".

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

mujer_esponja

Thanks Phil, my solution was executing a Script from my project, because I think there is no other solution.
Anyway, my output files, are (the ones which are not the first one in my inDir) in this way:

[,
{
  "SourceFile": "pepe/AnimalsPlayingSoccer.flv",
  "ExifToolVersion": 8.32,
   (....)
}]


I tryed with several options to try to avoid this first ',' character, guessing this is not another tag, so -x option doesn't do what I want to. Am I right??
Is there any solution? I saw tha with xml files, I don't get this ',' but I have a lot work using JSon files and I wouldn't want to change everything to this xml.

Thanks again.

Phil Harvey

I tried many things but can't get this comma in the output.  What is the exact command you are 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 ($).

mujer_esponja

exiftool -a -u -g1 -j -k -r -w outDir/%f.json inDir

If in inDir there are many files to extract metadata from, I get one JSon file for each one, but from the second until the last one, start whith this coma.
Because if -w option doesn't appear, I get just one file with all metadata information in this folder from all files in it, separated by comas, so spliting this file I get exaclty these comas.
Sorry for my English!! I know is terrible :)

Thanks Phil!

Phil Harvey

Thanks.  I'm getting the comma now.  I'll let you know when I've figured out what is causing this.

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

mujer_esponja


Phil Harvey

I have found the problem, and it will be fixed in the next release (version 8.34).

Thanks for pointing this out.

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

mujer_esponja