ExifTool Forum

ExifTool => Newbies => Topic started by: aazimmy12 on June 22, 2022, 04:21:26 PM

Title: Extra Spaces in Tag Value
Post by: aazimmy12 on June 22, 2022, 04:21:26 PM
Hi! I am new Exiftool and I am trying to remove the spaces from my tag value before the value of the tag. My tag looks like TAG:                      1.234 and I want it to be TAG: 1.234. I have to do this for a bunch of photos, so I am trying to find a way to rid all of the extra spaces from the tag from a bunch of JPG photos. I am using Windows and have the most updated version of Exitool.
Title: Re: Extra Spaces in Tag Value
Post by: StarGeek on June 22, 2022, 08:57:11 PM
Are the spaces actually part of the tag or are you looking at the spaces that exiftool prints to separate the tag name and the tag value.

Is it like this
Description                     : Test
or like this
Description                     :                Test

The the former case, you would use the -s2 (-short2) option (https://exiftool.org/exiftool_pod.html#s-NUM--short).  In the second case, if you want to rewrite the tags to remove leading spaces that are actually part of the tag, you would use
exiftool -api "Filter=s/^ +//" -TagsFromFile @ -Description /path/to/files/