I am trying to use an advanced formatting expression with the -p option, for multiple files.
The command line I'm using seems to apply the formatting expression to only 1 file.
How can the -p option, modified by a formatting expression, be applied to multiple files with the same command line?
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
Active code page: 1252
F:\>exiftool -ver
9.29
F:\>exiftool -p $filesize file1.jpg file2.jpg
89 kB
105 kB
2 image files read
F:\>exiftool -p "${filesize;s/kB/kilobytes/}" file1.jpg file2.jpg
89 kilobytes
2 image files read
89 kilobytes
F:\>
Thanks,
Jim
Hi Jim,
But it did work for both files.
You may be confused because it seems that stderr is getting flushed before stdout, so the "2 image files read" line comes out of sequence.
- Phil
Hi Phil.
I am confused.
file1.jpg is 89 kB and file2.jpg is 105 kB. I showed this in my previous example.
If the "2 image files read" line is merely out of sequence, I expect this:
F:\>exiftool -p "${filesize;s/kB/kilobytes/}" file1.jpg file2.jpg
89 kilobytes
2 image files read
105 kilobytes
Here's another example:
F:\>exiftool -p "$filename ${filesize;s/kB/kilobytes/}" file1.jpg file2.jpg
file1.jpg 89 kilobytes
2 image files read
89 kilobytes
F:\>
Why is the filename and filesize for file2.jpg not shown in the output?
Thanks,
Jim
Hi Jim,
Ooops. I totally missed that.
Weird.
I'll look into this.
- Phil
Good catch! That was a bug. It will be fixed in 9.30.
The fix also fixes the ordering problem in the output.
Thanks for pointing this out!
- Phil
Thank you Phil.
Adding the advanced formatting functionality was a great idea. I'll look forward to the fix.
Thanks again for the outstanding support.
Jim
The fix is in.
Advanced formatting worked correctly for multiple files in ver 9.30.
Thanks
Hi Jim,
Glad it worked. Thanks for the confirmation.
- Phil