Announcement

Collapse
No announcement yet.

[Tutorial] How to batch rename sequence of'unfriendly' camera/scanner imgs w/ backups

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Tutorial] How to batch rename sequence of'unfriendly' camera/scanner imgs w/ backups

    Summary:
    This is a tutorial is about using Beyond Compare to usefully rename a batch of photograph or scanner capture/acquired images, when you deliberately have more than one copy of the set for backup.

    Scenario detail:
    With photographs or scanned images, I like to keep backup copies of the images, say 2 identical copies for backup. The backup is reassuring if the images are of value or if they are a client's.

    Cameras and scanners store the images with unfriendly filenames such as DCIM0001.JPG for cameras or EPSON0001.JPG for a scanner. These don't say anything about the image.

    Renaming to something useful can help searches for files and future references. And if the images are a sequence of scanned documents (as in my example here), a page number per image will retain the order.

    However, if like me, you have a lot of images to work with, sometimes doing the rename in one session isn't possible due to lack of time. You may only partially get the rename done. For example one of your copies will be renamed while the other is not. So when you return at a later date, how do you compare the backups to check they are the same?

    My example provides a solution. It's aimed around a document pages scanning scenario where the sequence of page numbers is important but would apply to similar scenarios with say photography.

    So I start off with my 2 identical backups...
    1. Step 1. I select all, both sides of the directory compare of the backup images. Select rename. And then enter a regex rename:



      Old Mask: (.*).(JPG)
      New Mask: Interviews_and_Negotiation_Booklet_$1.$2
    2. Step 2. I inspect each image (in Windows Explorer or image viewing package) and rename to apply a prefix page/sequence number to the files in one of the backups, e.g. 001_ 002_ ... etc


    3. Step 3. I return to the same beyond compare session comparing the 2 folders. Hit refresh and see all blue text indicating no comparison matches - the files between the backups are differently named.


    4. Step 4. I select both sides, all files then I goto Session Menu Heading, select Session Settings and then the Misc tab in the pop up. I enter the following Session overide regex. And click OK.



      (\d{3}_)(.*)\.JPG=$2.JPG

      The files now match on both sides because the prefix index is ignored but Beyond Compare can still match because the machine generate sequence number, e.g. EPSON0001 is still in the filename on both sides.


    5. Step 5. Knowing the files match, I remove/delete the backup files on the side without the prefix page number I added, because I want to now make the backup have the same filename format as that with the sequence prefix 001, 002 etc.



    6. Step 6. Finally I remove the machine generate suffix, using the regex rename




      Old mask: _EPSON\d{3}.JPG
      New mask: .JPG


    I'm not too happy with Step 5 because I have to delete one of the backups, I'd prefer to avoid this and have Beyond Compare copy from left to right and perform a rename from the left hand side.

    Hope this is useful. Any thoughts welcome: do you find this sort of thing useful? Is there a better way? Etc.

  • #2
    Hello,

    Thanks for the tutorial. A Touch-Rename command is on our Customer Wishlist.

    I would like to point out that you can enable a content comparison (such as CRC, Binary, or Rules-based) to determine if files are identical once aligned. You can also perform a Move To Folder to transfer your files out of the current location instead of deleting them, in case you want to keep them as a backup until you've verified your new copy is also identical (using CRC, Binary, or Rules-based scans).
    Aaron P Scooter Software

    Comment


    • #3
      Originally posted by Aaron View Post
      Hello,

      Thanks for the tutorial. A Touch-Rename command is on our Customer Wishlist.

      I would like to point out that you can enable a content comparison (such as CRC, Binary, or Rules-based) to determine if files are identical once aligned. You can also perform a Move To Folder to transfer your files out of the current location instead of deleting them, in case you want to keep them as a backup until you've verified your new copy is also identical (using CRC, Binary, or Rules-based scans).
      Touch-Rename is exactly what I want, the reason why I delete the other side's files is because they have the old filenames. I then replace them with the newer filename files which are identical. So the result is 2 copies (1 for backup) both sides having the same filenames.

      Comment

      Working...
      X