Prepend the file name on each output line

Started by Martin B., January 22, 2024, 09:44:12 AM

Previous topic - Next topic

Martin B.

Hi,

Is there a way to get an output like this (note the file name at the beginning of each line):
IMG_0001.JPG:Canon Camera Info Unknown 0x0000: -86
IMG_0001.JPG:Canon Camera Info Unknown 0x0001: -69
IMG_0001.JPG:Canon Camera Info Unknown 0x0002: 0
...
IMG_0001.JPG:Canon Shot Info 0x000b          : 8
IMG_0001.JPG:Canon Shot Info 0x000c          : 154
...
IMG_0002.JPG:Canon Camera Info Unknown 0x0000: -43
IMG_0002.JPG:Canon Camera Info Unknown 0x0001: -11
IMG_0002.JPG:Canon Camera Info Unknown 0x0002: 0
...
IMG_0002.JPG:Canon Shot Info 0x000b          : 7
IMG_0002.JPG:Canon Shot Info 0x000c          : 152
etc.

from a command like this:
exiftool -U "-Canon_CameraInfoUnknown_*" "-Canon_shotinfo_*" "-Canon_fileinfo_*" "-Canon_CMP1_*" "-Canon_IAD1_*" .

I tried the -tab option, but this option is to get one line per file, whereas I need as many lines per file as the number of tags that ExifTool finds.

Right now, I post process the output of exiftool -w out/%f_%e.txt with grep Canon * > all_results.txt to get all results in a single file, but my instinct tells me there's an easier way.

Thanks!

StarGeek

Offhand, I don't think so.

The -p (-printFormat) option gives a lot of flexibility in formatting the output, but it doesn't allow the use of wildcards when listing tag names. You have to specify each tag you want to list individually and would fail if the tag doesn't exist unless the -m (-ignoreMinorErrors) option/-f (-ForcePrint) option is used.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Martin B.

Thanks StarGeek. I had also looked at the -p option and came to the same conclusion.