Author Topic: Suppress units of measure  (Read 146 times)

ekkidee

  • Jr. Member
  • **
  • Posts: 19
Suppress units of measure
« on: March 25, 2019, 05:11:56 PM »
Is it possible to have exiftool suppress the unit of measure on some fields?

I am using exiftool to dump the contents of various parameters in image files, and some in particular come back with units attached:

HyperfocalDistance: incudes "m" for meters
FocalLength: includes "mm" for millimeters
Couple more maybe ....

If the units are dropped, I can import the values into an Excel sheet as numbers where they sort properly.

I am fine w/ meters as a unit, but I know there is considerable power over the formatting of output from exiftool and I wonder if there is a way to suppress the "m" and "mm" on output of these fields.

Thanks.

Alan Clifford

  • ExifTool Freak
  • *****
  • Posts: 385
    • A selection of Alan Clifford's photographs
Re: Suppress units of measure
« Reply #1 on: March 26, 2019, 08:59:46 AM »
exiftool -s3 -n -focallength p340_1778.jpg

gives

Code: [Select]
5.1

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2514
Re: Suppress units of measure
« Reply #2 on: March 26, 2019, 10:58:11 AM »
You can also add a hashtag to the end of any tag name to suppress the printconv on individual tags rather than suppress it globally (see -n (printConv) option docs).

If you're dumping all tags and not listing specific tags, I believe you'll have to create your own tag definition.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

ekkidee

  • Jr. Member
  • **
  • Posts: 19
Re: Suppress units of measure
« Reply #3 on: March 26, 2019, 08:45:05 PM »
Oh my, that's so simple (and so obvious in the man page), thank you for pointing it out.