Remove _ and - from tags when writing based on file name

Started by avalut, January 02, 2019, 05:54:22 PM

Previous topic - Next topic

Stephen Marsh

Where do I find the "full tag names"


I use the following command on a file with known metadata populated in the target fields, in order to confirm which fields should be written in other files:

exiftool -a -G1 -s FILE


https://exiftool.org/index.html#tagnames

https://exiftool.org/faq.html#Q2

avalut

for some reason the tags are still writing the jpg at the end of the descriptions with .jpg"

How do I delete that, I didn't notice it was still writing that element it was supposed to have removed that, I thought the -ext jpg woud remove it.

so all tags below have same issue ?

Thanks in advance.

Andrew

perl c:\windows\exiftool.pl -P -r "-title<${filename;s/\.[^\.]+$ //;s/[-]/ /g;s/_/ /}"" -r -sep " " -ext jpg C:\Users\Andrew\Desktop\SilverstoneImages
perl c:\windows\exiftool.pl -P -r "-description<${filename;s/\.[^\.]+$ //;s/[-]/ /g;s/_/ /}"" -r -sep " " -ext jpg C:\Users\Andrew\Desktop\SilverstoneImages
perl c:\windows\exiftool.pl -P -r "-IFD0:XPSubject<${filename;s/\.[^\.]+$ //;s/[-]/ /g;s/_/ /}"" -r -sep " " -ext jpg C:\Users\Andrew\Desktop\SilverstoneImages
perl c:\windows\exiftool.pl -P -r "-IFD0:XPComment<${filename;s/\.[^\.]+$ //;s/[-]/ /g;s/_/ /}"" -r -sep " " -ext jpg C:\Users\Andrew\Desktop\SilverstoneImages

Phil Harvey

It is this part that should remove the file extension:  s/\.[^\.]+$//

... but you have a space after the dollar sign that would stop this from working.

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

avalut

Not using that site, was just looking at placing on a site, but maybe it will pick the tags up in any event.

avalut

Hi Phil,

Bugger, didn't notice that.. ahahah that's why it was working and then didn't and I copied the error into the other tags.
Thank you, will fix it now.

Added the codes into Ubot and with their shell scrip plugin can run from it, so my program does now what I need as far as downloading the images/renaming and then applying all the tags from one program.

Thanks again
Andrew

avalut

Hi Phil,

I am still getting an addtional " at the end of the description as per
Lot 117_1 Signed Mercedes Benz 300SE door"

There seems to be to many " in the string, which one is the odd one out ?
Andrew

Stephen Marsh

Remove the red "

perl c:\windows\exiftool.pl -P -r "-title<${filename;s/\.[^\.]+$//;s/[-]/ /g;s/_/ /}"" -r -sep " " -ext jpg C:\Users\Andrew\Desktop\SilverstoneImages
perl c:\windows\exiftool.pl -P -r "-description<${filename;s/\.[^\.]+$//;s/[-]/ /g;s/_/ /}"" -r -sep " " -ext jpg C:\Users\Andrew\Desktop\SilverstoneImages
perl c:\windows\exiftool.pl -P -r "-IFD0:XPSubject<${filename;s/\.[^\.]+$//;s/[-]/ /g;s/_/ /}"" -r -sep " " -ext jpg C:\Users\Andrew\Desktop\SilverstoneImages
perl c:\windows\exiftool.pl -P -r "-IFD0:XPComment<${filename;s/\.[^\.]+$//;s/[-]/ /g;s/_/ /}"" -r -sep " " -ext jpg C:\Users\Andrew\Desktop\SilverstoneImages


Stephen Marsh


Stephen Marsh

Quote from: Phil Harvey on January 03, 2019, 10:31:22 AM
You should be able to combine all your commands into 2 commands.  The complication is that the -sep " " will write each word separately when writing a list-type tag, so you need one command with -sep " " and one without so that the words don't get written as separate items when writing tags like XMP:Subject.

- Phil

Ah, thank you Phil, I did not consider the separator bit when I made the simple suggestion to combine the various arguments into one!

Thinking out loud, couldn't one use the execute argument to string together two separate commands into a single command?

https://exiftool.org/exiftool_pod.html#execute-NUM

Phil Harvey

Quote from: Stephen Marsh on January 04, 2019, 07:06:57 AM
Thinking out loud, couldn't one use the execute argument to string together two separate commands into a single command?

Yes.  I was would have mentioned this but I was worried about information overload.

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