Extra Spaces in Tag Value

Started by aazimmy12, June 22, 2022, 04:21:26 PM

Previous topic - Next topic


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.


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.  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/
* 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).