How to make c option start from 1 in numbering output files

Started by Anders Nilsson, June 09, 2018, 04:41:25 AM

Previous topic - Next topic

Anders Nilsson

Hi!

Asking my first question after having used ExifTool for some time, please bear
with me if this is simple, but I have read the documentation and cannot figure
out how to make small "c" start numbering from one.

Assuming I have a set of JPG/RAW image pairs just moved from my SD card to
some directory on my drive:

G:\Anders\Pictures\2018\04\12>exiftool -d %Y%m%d_7-%%1.3c.%%e "-testname<CreateDate" .
'./DSC03131.ARW' --> './20180412_7-000.ARW'
'./DSC03131.JPG' --> './20180412_7-000.JPG'
'./DSC03132.ARW' --> './20180412_7-001.ARW'
'./DSC03132.JPG' --> './20180412_7-001.JPG'
'./DSC03133.ARW' --> './20180412_7-002.ARW'
'./DSC03133.JPG' --> './20180412_7-002.JPG'
'./DSC03134.ARW' --> './20180412_7-003.ARW'
'./DSC03134.JPG' --> './20180412_7-003.JPG'
'./DSC03135.ARW' --> './20180412_7-004.ARW'
'./DSC03135.JPG' --> './20180412_7-004.JPG'
'./DSC03136.ARW' --> './20180412_7-005.ARW'
'./DSC03136.JPG' --> './20180412_7-005.JPG'
'./DSC03137.ARW' --> './20180412_7-006.ARW'
'./DSC03137.JPG' --> './20180412_7-006.JPG'
'./DSC03138.ARW' --> './20180412_7-007.ARW'
'./DSC03138.JPG' --> './20180412_7-007.JPG'
'./DSC03139.ARW' --> './20180412_7-008.ARW'
'./DSC03139.JPG' --> './20180412_7-008.JPG'
'./DSC03140.ARW' --> './20180412_7-009.ARW'
'./DSC03140.JPG' --> './20180412_7-009.JPG'
    1 directories scanned
    0 image files updated
   20 image files unchanged


Obviously, capital C starts from what I put in front of the . but then JPG/RAW pairs
are not kept together in the renumbering.

If this can be solved it saves me from buying another license of ACDSee so I would really
be happy for a solution. Ok, I can live with the zero based numbering but to me it is
really ugly.

(The _7 if You wonder is just my way of keeping track of which camera took the pictures)

Phil Harvey

%nc starts numbering from 1.  So try %.3nc.

- Phil

Edit:  I was re-reading the documentation and looking at the code.  Currently, %1.3c has the same effect ast %.3c (which is also the same as %3.c).  Currently the behaviour is not specified if you provide two numbers (one before and one after the decimal point), and as implemented the larger number is used for the number of digits (so %1.3c also currently has the same effect as %3.1c).  I'm thinking that I could change this to support a starting number like %C when two numbers are given without breaking backward compatibility too badly.  I'll think more about this.
...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 ($).