add Image Title to file name, but only if it exists

Advanced Renamer forum
#1 : 09/12-18 20:34
Blake Young`
Blake Young`
Posts: 1
Some of my photos have Image Title filled out, but many do not. I am trying to batch rename about 2000 photos, and if the photo has Image Title information, I want it appended to the end of the file name, otherwise it should be left blank. But if I just do:

<Img Year>-<Img Month>-<Img Day> - <Img Title>

the resulting filenames don't look very pretty if the photo does not have Img Title information. If the above rule is applied to 2 photos, one that has an Img Title and one that doesn't, the output is:

2017-06-15 - First Father's Day.jpg
2017-06-15 - .jpg

Obviously that doesn't look good. I would rather the output look like:

2017-06-15 - First Father's Day.jpg
2017-06-15.jpg

How can I go add a conditional statement to only add Img Title if it exists, otherwise ignore it and don't put the preceding hyphen?


09/12-18 20:34
#2 : 10/12-18 00:47
David Lee
David Lee
Posts: 1125
Reply to #1:
A simple solution is to add a "Replace" method after the "New name".

Text to be replaced: " - .jpg"
Replace with: ".jpg"
Apply to: "Name and extension"


10/12-18 00:47
#3 : 10/12-18 11:10
David Lee
David Lee
Posts: 1125
Reply to #2:
Alternatively - add a "Remove pattern" method.

Pattern: " - $"
Use regular expressions
Apply to: "Name"


10/12-18 11:10