change a character in a tag

Started by wickie22, January 30, 2018, 04:16:40 PM

Previous topic - Next topic

wickie22

Hello,

I am searching for an option to change the character of the tag 'subject' from / to |.

I tagged my images with a software "Windows Fotogalerie" that structures the tag-tree with a "/". I had to change the software to XNview MP and unfortunately this uses "|" to separate the levels of the tag.

Is there a posibility to search for all characters "/" in the tag field "subject" and replace them by "|".

Thank you a lot and!

Eric

StarGeek

Try this
exiftool -api "filter=tr(/)(|)" -TagsFromFile @ -subject FileOrDir

This command creates backup files.  Add -overwrite_original to suppress the creation of backup files.  Add -r to recurse into subdirectories. 

"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

olball

Quote from: wickie22 on January 30, 2018, 04:16:40 PM
I tagged my images with a software "Windows Fotogalerie" that structures the tag-tree with a "/". I had to change the software to XNview MP and unfortunately this uses "|" to separate the levels of the tag.

Is there a posibility to search for all characters "/" in the tag field "subject" and replace them by "|".

This is possible with exiftool (e.g. with the -api filter option):

exiftool -subject test.jpg
Subject                         : Test/Test2/Test3

exiftool -api "Filter=s#/#|#g" -tagsfromfile @ -subject test.JPG
    1 image files updated

exiftool -subject test.JPG
Subject                         : Test|Test2|Test3


But maybe a simple solution is to change the separator in XNView MP. Check Tools\Settings\Metadata\Read Hierarchical Keywords. There are 4 possibilities: "|" "/" "\" ":"

wickie22

Hallo StarGeek, hallo olball

Eure Lösungen klappen beide super!

Besten Dank für deine schnelle Hilfe!

Viele Grüße

:)