Main Menu

Extra Spaces in Tag Value

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

Previous topic - Next topic

aazimmy12

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.

StarGeek

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/
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype