Author Topic: Renaming using the camera generated image count  (Read 3510 times)

BenAW

  • Sr. Member
  • **
  • Posts: 423
Renaming using the camera generated image count
« on: October 23, 2013, 10:48:36 AM »
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]
« Last Edit: October 23, 2013, 01:16:13 PM by BenAW »

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 31554
Re: Renaming using the camera generated image count
« Reply #1 on: October 23, 2013, 12:59:29 PM »
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.
« Last Edit: October 23, 2013, 01:23:05 PM by Mario »

nacho02

  • Jr. Member
  • *
  • Posts: 63
  • Imatch User since 2005
Re: Renaming using the camera generated image count
« Reply #2 on: April 22, 2014, 09:25:06 PM »
Very useful Topic. Thanks both of you for posting this.
Ignacio