Deleting excess "spaces" around hierarchical separator

Started by horvjan, November 27, 2016, 02:43:01 PM

Previous topic - Next topic

horvjan

Hello,

Let me ask your help as a ExifTool Newbie. I started to use ExifTool through FastPhotoTagger app. I used this app to add IPTC keywords to my images. I gave several keywords to each picture separeted by ";". But I made a mistake when I thought I should put space around (before AND after) the separator. (Ok, you are right it was stupid, but pls be gentle, as mentioned before I am a Newbie... still learning)

Is there a way to mass delete these obsolete spaces around the separator? There are a lots of folders (Folder name = Original date of the image; image name= Original date (YYYYMMDD) and original time (hhmmss) something like this 20161126_203923.jpg.

Thanks in advance.

horvjan

Phil Harvey

Yes, try this:

exiftool -sep ";" "-keywords<${keywords;s/\s*;\s*/;/g}" DIR

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

horvjan

Thank you Phil, it works fine on one directory.
How could I use this to work on every subfolder as well?

StarGeek

"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