-p with .fmt file not working. I must notunderstand the documentation

Started by calberga, October 04, 2016, 03:12:26 PM

Previous topic - Next topic

calberga

I am trying to produce listing for tags to be processed further.  I have tag values which contain commas,  so -csv doesn't work, and a few values contain tab character, so -T doesn't work.

I created a one line (test) .fmt file, Fileid.fmt:

$ObjectName|$Directory|$Filename

and used the command:

D:\P\exiftool\exiftool -r -ext jpg -L -api missingtagvalue="ยง" -p Fileid.fmt D:\P\Photographs > D:\P\X\D-Fileids-unsorted.txt


The result is a file containing :

Fileid.fmt
Fileid.fmt
Fileid.fmt
Fileid.fmt
Fileid.fmt
Fileid.fmt
...


one line for each file in the directory structure.

I thought I was cribbing from the documentation for -p and the FAQ on exporting to databases, but clearly I''ve missed some crucial bit here.

Phil Harvey

The -csv option works fine when a value contains commas.  ExifTool uses the standard CSV quoting/escaping techniques to allow any character in the value.

Your -p didn't work because the file "Fileid.fmt" didn't exist in the current directory when you ran the command.

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

calberga

Pretty dumb (of me).  Thanks.  Problem with the .csv files is that I'm using a LISP function the cuts up the string at each instance of a sub-string, and it doesn't knwo how to ignore "escaped" commas.  I was using -T, but for reasons that I haven't figured out the DateTimeOriginal tag in a few files seems to have sprouted tab characters.  Rather than hunt them  down and do something about it I decided to chance the separator to | which I don't think will ever creep in.

Either that or re-write the decompose-string function, but handling escaped character would slow it down badly.  Once you have a string in LISP it itself doesn't have any escapes in it, they only occur in the printed/readable representation.