My format file has only these 2 lines
#[HEAD]Filename,ImageHeight,ImageWidth,Country,State,City,Sublocation,Description
$Filename,$ImageHeight,$ImageWidth,$Country,$State,$City,$Sub-location,$Description
When I process a folder, I get the heading on row 1 as expected, but every row of tag data is ended with a copy of the heading.
Example:
Filename ImageHeight ImageWidth Country State City Sublocation Description
DSC_0302.jpg 1488 2240 Denmark _ Copenhagen _ The Radisson SAS Scandinavian lobby[i]Filename ImageHeight ImageWidth Country State City Sublocation Description[/i]
If I add a #[TAIL] to the format file, the headings are repeated on a line after the data for each file, instead of being on the same line.
This happens whether or not I use the -r option.
I've re-read the sections on -p -W and -r several times and can't seem to discover my error.
You example doesn't make sense given your format file. You format file is comma-separated, but your example output has spaces.
Anyway, this is what I get with your format file and two random input files:
> exiftool -p a.fmt a.jpg b.jpg -m
Filename,ImageHeight,ImageWidth,Country,State,City,Sublocation,Description
a.jpg,960,720,,,,,
b.jpg,8,8,,,,,
2 image files read
- Phil
P.S. You mentioned -W, which can not be combined with -p.
In my last post, I pasted my output from the displayed quasi-csv file in Excel, rather from a plaintext editor. The values ARE properly comma-separated as shown here (using -W+, even though it gave no errors):
Filename,ImageHeight,ImageWidth,Country,State,City,Sublocation,Description
DSC_0302.jpg,1488,2240,Denmark,_,Copenhagen,_,The Radisson SAS Scandinavian lobby
Filename,ImageHeight,ImageWidth,Country,State,City,Sublocation,Description
DSC_0305.jpg,1488,2240,Denmark,_,Copenhagen,_,Checking in
When I tried using exiftool with -o I could not get it to process a directory AND let me specify an output file (vs stdout). Here's my parameter list:
-f -Filename -ImageHeight -ImageWidth -Country -State -City -Sub-location -Description -api MissingTagValue=_ -p exif_out_rules.fmt -ext jpg -W+ E:/outfile.txt E:/inputdirectory
I also tried replacing the -W+ with -0 E:/outfile.txt which gave me no output
OK,
-W+ is possible, but not
-W.
Quote from: DocDJ on February 17, 2023, 10:01:43 AMIn my last post, I pasted my output from the displayed quasi-csv file in Excel, rather from a plaintext editor. The values ARE properly comma-separated as shown here (using -W+, even though it gave no errors):
Filename,ImageHeight,ImageWidth,Country,State,City,Sublocation,Description
DSC_0302.jpg,1488,2240,Denmark,_,Copenhagen,_,The Radisson SAS Scandinavian lobby
Filename,ImageHeight,ImageWidth,Country,State,City,Sublocation,Description
DSC_0305.jpg,1488,2240,Denmark,_,Copenhagen,_,Checking in
Hmmm, yes. This is unfortunately expected. The
-W option was actually designed for a completely different purpose, and adding the
-W+ feature was a bit of a hack. I don't know if I can further patch the logic to work the way you want with
-p but I'll take a look. It is more complicated than it seems because the
-W option is designed to write a separate file for each extracted tag.
QuoteWhen I tried using exiftool with -o I could not get it to process a directory AND let me specify an output file (vs stdout).
The
-o option is used to specify the output for image files when editing metadata.
QuoteHere's my parameter list:
-f -Filename -ImageHeight -ImageWidth -Country -State -City -Sub-location -Description -api MissingTagValue=_ -p exif_out_rules.fmt -ext jpg -W+ E:/outfile.txt E:/inputdirectory
All of the tag names you specified on the command line are ignored with the
-p option.
But I see what you are trying to do, and I understand the problem. The basic problem is that you want an alternative to shell redirection for the ExifTool output, and ExifTool doesn't really provide that.
This may require adding a new option to ExifTool... I'll have to think about this.
- Phil
Hi Phil,
Thank you so much for considering this. You have been very helpful getting me this far.
PS. I really liked the (serendipitous) output I got with -p and -W+ except for the duplicated headings. Maybe you could make it legal? It really did everything else I wanted.
FYI: I had added redirection for STDOUT and STDERR in the main dialog (to catch messages in the main program), but when I tried the -csv option (with & without the -p), just to test my theory, no exiftool output appeared in the redirected file and exiftool exited with a return code of 0. So it wrote "something", "somewhere", but I have no clue where.
OK. I've patched the issue of the duplicated HEAD lines for the command you are using, and ExifTool 12.57 (to be released within a day or two) should fix this.
- Phil
Version 12.57 is now available.
- Phil
Phil,
Thank you so much for making this work and getting it done so quickly. Just tested it and it's exactly what I needed.