Renaming using the camera generated image count

Started by BenAW, October 23, 2013, 10:48:36 AM

Previous topic - Next topic

BenAW

A lot of cameras create filenames where the last 4 digits are a camara specific image counter, like:

DSC_xxxx.JPG
P100xxxx.JPG
IMGPxxxx.PEF

If you want to use the imagecounter xxxx in a new filename, use this variable:  {File.Name|substrr:0,4}

A Renamer preset that is good for all filenames that have this counter, regardless of the rest of the name, looks like this:



[attachment deleted by admin]

Mario

#1
For the likes like me who read too fast and then wonder:

{File.Name|substrr:0,4}

the key is the r at the end of the substrr, it extracts from the end of the file name.

If your image counters becomes larger that four digits (10,000+ files) the above substring will fail to extract the complete number.

Another approach which will work nicely when your camera uses a fixed-length prefix like _DSC or IMGP followed by any number of digits is using substring:

{File.Name|substr:4}

This strips the first 4 characters from the file name, so the _DSC or IMPG prefixes will be removed.


Digits of Original File Name

Yet another alternative is to use the Digits of Original File Name step which extracts all digits from the original file name by searching for the first digit (ignoring any leading characters or _) and then stops when the first non-digit is reached (the . of the extension usually).

Whatever your specific rename problems may be, there is a very good chance that you can find one or more approaches with the arsenal of features provided by the Renamer.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

nacho02

Very useful Topic. Thanks both of you for posting this.
Ignacio