How to add zero to num %nC from 1 to 9 only?

Started by lmiol, June 25, 2023, 09:06:16 AM

Previous topic - Next topic

lmiol

-Exif:DocumentName<$filename -tagsfromfile "PXL_20230617_172302528.BURST-1.jpg" "-filename<PXL_${DateTimeOriginal;my $temp=$self->GetValue('OffsetTimeOriginal');$temp=~tr/-+/+-/;ShiftTime($temp);DateFmt('%Y%m%d_%H%M%S')}${subsectimeoriginal}.BURST-%nC.%e" -fileorder filename .
Right now here "%nC" nums like this:
1
2
..
9
10
11

how to add zero but only from 1 to 9?
01
02
..
09
10
11
?

thx in advance

lmiol

chatgpt suggest this one
%2nc
but i got this result
02
03
...
09
10
11

but 01 doesn't created

lmiol

Solution found (chatgpt 4)
this one works great
%2.2nc

StarGeek

See the -w (-TextOut) option under "Advanced features".  The docs detail all the options for the % variables.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).