Name collision: how to add sub second to both files?

Advanced Renamer forum
#1 : 10/08-19 16:39
Gauthier
Gauthier
Posts: 3
Hi,

Name collision rule with sub second is great, but I noticed that the 2nd file is not added sub second, only the first. Not a blocking issue, but that makes the 2nd image being listed as the 1st one. Is there a way to make the Name collision rule to also append sub second to the last file of the collision set?

e.g. with sub second:
- 1st file:  2019-08-10 16-10-05 => 2019-08-10 16-10-05.63
- 2nd file: 2019-08-10 16-10-05 => 2019-08-10 16-10-05      (no change)
                  but I would like to have: 2019-08-10 16-10-05.73 (to have them listed chronologically)

Regards,
Gauthier


10/08-19 16:39 - edited 10/08-19 16:44
#2 : 10/08-19 20:47
David Lee
David Lee
Posts: 293
You can do this in two passes...

In the first pass use the "Append number" collision rule (instead of "image sub second") using a separator that will never appear in a filename - eg "#".

Unlike the subsecond collision rule "Append number" will modify every colliding filename.

Run the batch, reloading all files.

Then in a second pass use the Replace method using regular expressions...
Replace: "#\d{3}$"
with: ".<Img Subsec>"

Alternatively you could simply add the subsecond to the end of every filename, irrespective of whether or not there is a collision.

Add method...
Add: ".<Img Subsec>"
At index: 0
Backwards


10/08-19 20:47
#3 : 10/08-19 21:25
Gauthier
Gauthier
Posts: 3
Many thanks David, I'll use the 2-pass solution, which I simplified thanks to your 2nd proposal:
- 1st pass: <ExifTool:DateTimeOriginal> with Name collision rule=Fail
- 2nd pass: [Add items with errors] and apply <ExifTool:DateTimeOriginal>.<Img Subsec>

Although I'm not sure that the sub second comes from Exif data even for HEIC?

Anyway it seems to do the job!
Edit: except when <img subsec> is less than 100, leading zero(s) are stripped...

Regards,
Gauthier

PS: thanks to the dev for your great renaming tool!


10/08-19 21:25 - edited 10/08-19 22:06
#4 : 10/08-19 23:16
David Lee
David Lee
Posts: 293
Reply to #3:
Assuming that all your filenames are in the same format as your examples - you can replace the leading zeroes using the Renumber method...

Number position: 6
Change to : Relative to existing number
Number difference: 0
Zero padding: Manual
Number length: 2


10/08-19 23:16
#6 : 11/08-19 19:09
Gauthier
Gauthier
Posts: 3
Thanks again David, I didn't know the renumber method. Much easier than a regex!
(note: number position is 7) ;-)


11/08-19 19:09