A question on renaming file on import

Post Reply
Larry56
Posts: 405
Joined: 05 Jul 10 6:57

A question on renaming file on import

Post by Larry56 » 15 Oct 15 3:19

I have a new camera and wanted to start importing images into PS3 using yyyymmdd-IMAGE NUMBER-Event. The camera assigns an image number and I want to include that number in the "IMAGE NUMBER" area of the import. I used the "File number (numeric part of file name)" in the macro. I expected a camera file name of sol_1234.jpg to be renamed to 20151014-1234-Cameras.jpg with the event being "Cameras". What I got was 20151014-531388-Cameras.jpg. The 531388 increased by one for all imported image files and I don't know where that number came from in the first place.

Isn't that macro field to have picked the 1234? Is there a better way to set this up?

vlad
Posts: 895
Joined: 01 Sep 08 15:20

Re: A question on renaming file on import

Post by vlad » 31 Oct 15 13:26

I haven't used the renaming facility in a while but I think 531388 came from an internal counter maintained by the PSU database. (You could use it to ensure your file names are unique.) I don't know if there's any macro for the number part of your existing filename, especially as a file name might have multiple number parts.

Mike Buckley
Posts: 1194
Joined: 10 Jul 08 14:18

Re: A question on renaming file on import

Post by Mike Buckley » 31 Oct 15 14:26

I didn't respond earlier because I didn't understand your issue. Now that I think I do thanks to Vlad's post...

I don't know what the FileNumber macro calls other than that the first part of the number it returns seems to be the date the image was captured. It's the last part of the number that confuses me. I have no idea why the number 531388 is returned on your system, as that part of the number returned on my system is only three digits and it's a very different number than what is being returned on your system.

You will need to write a custom macro to return the number in your original file name. To do so, use the following macro: %FileName{right=4}. That macro will return the last four digits on the right end of the pre-existing filename. That and other custom macro parameters are explained in the QuickStart Macro document found in the Help menu. The parameter, right, is the second parameter explained in the list of parameters displayed beginning on page 3 of the document.

Having said all that, I recommend that you NOT use that macro as part of your file-naming convention depending on how your camera assigns the number once it gets past number 9999. If it then assigns a five-digit number, the macro parameter explained above will have to be changed to using the right five digits rather than the right four digits. Remembering to make that change at exactly the right time will be next to impossible, at least for someone whose brain is as small as mine. It's probably more likely that your camera does not eventually generate a five-digit number and instead will restart the sequence of four-digit numbers, which presumably will begin with 0001. However, if that sequence begins instead with 1 (rather than 0001), when displaying your images in order of file name, the order will be wrong.

To be safe by avoiding all of that, I recommend that you use the %ImageNumber macro. When using the renaming tool, click the line displaying that macro to display the graphical interface and configure the various settings as follows:
Offset =1
Continuous Offset disabled or enabled depending purely on your choice (I disable it)
Increment = 1
Length padding = 4 (keeping in mind that if you are going to import more than 9999 images in one session you should change that to at least 5)
Reset Number = whatever setting fits your personal needs. (I use "don't reset.")

If your intent is to always have access to the file number generated by your camera perhaps without having the potential complications explained above when displaying it as part of your renamed file name, I'm currently at a loss about how to make that happen. If your intent is to instead know the shutter count of your camera, add a custom field to the Info panel using the macro %exifmakernote:ShutterCount.

Last, before deciding upon your file-naming convention, I recommend that you follow the best practices explained at http://dpbestflow.org/file-management/file-naming

Mike Buckley
Posts: 1194
Joined: 10 Jul 08 14:18

Re: A question on renaming file on import

Post by Mike Buckley » 31 Oct 15 15:27

I just now thought of another way to include the number generated by your camera in your renamed file name that avoids the hassle associated with the possibility that your camera changes the number of digits when it gets past number 9999. Simply use the Delete parameter to delete everything except the number in the file name. That parameter is explained in the Quick Manual Macro Commands document. Use it as a parameter of the macro, %FileName.

However, keep in mind that using that number doesn't avoid the issue already explained if your camera restarts the numbering cycle at number 1 (rather than 0001) after it gets to number 9999.

jstartin
Posts: 412
Joined: 23 Aug 06 13:47
Location: UK

Re: A question on renaming file on import

Post by jstartin » 31 Oct 15 23:59

Mike Buckley wrote:I don't know what the FileNumber macro calls other than that the first part of the number it returns seems to be the date the image was captured. It's the last part of the number that confuses me. I have no idea why the number 531388 is returned on your system, as that part of the number returned on my system is only three digits and it's a very different number than what is being returned on your system.
To avoid any doubt, selecting the "File number (numeric part of file name)" item inserts the %filenumber macro. I may not have tried every possible source string, but for me %filenumber consistently returns every numeric character in the file name with all non-numeric characters removed. It is not to be confused with %imagenumber which generates a sequence number. If I use %filenumber on a file named "sol_1234.ext" then "1234" is, indeed, the result.

Larry56 - Perhaps it would help work out why something unexpected is happening if you post the entire rename rule (as shown by the "Edit as text" option from the rename dialog menu).
Jim (Photo Supreme: AMD Quad-Core A8-5500 Accelerated Processor 3.2 GHz; SSD; 16GB DDR3 SDRAM; Win10x64)

Mike Buckley
Posts: 1194
Joined: 10 Jul 08 14:18

Re: A question on renaming file on import

Post by Mike Buckley » 01 Nov 15 10:53

jstartin wrote:To avoid any doubt, selecting the "File number (numeric part of file name)" item inserts the %filenumber macro. I may not have tried every possible source string, but for me %filenumber consistently returns every numeric character in the file name with all non-numeric characters removed.
Ahhhhhhhh. Yes, of course you are correct. At least that's how it works on your and my system.
Larry56 - Perhaps it would help work out why something unexpected is happening if you post the entire rename rule (as shown by the "Edit as text" option from the rename dialog menu).
Agreed. There has got to be something causing the unexpected number to appear.

snowman1
Posts: 305
Joined: 01 Jan 07 3:13
Location: UK

Re: A question on renaming file on import

Post by snowman1 » 01 Nov 15 12:30

I have only skimmed this thread so I may have got the wrong idea, but I think what I do is similar to what Larry is requesting.
My folder rename is "%yyyy\%yyyy-%mm\%yyyy-%mm-%dd %EventName\" and my file rename is "%yyyy%mm%dd_%hh%nn%ss_%xmp:tiff:Model_%FileName.%FileExtension".
I basically use the full file name, including the camera generated sequence number, and make it unique on disk by including the camera model (we don't have more than one of any one camera body) and date, which is slightly overkill but I like having the date in the file name.
Any file would almost certainly be be unique within folder anyway, but this scheme just helps me understand what a picture is by presenting the camera and date in the name, helpful if I am looking at flattened views of the disk such as a search across all folders.
HTH.
Snowman1
http://www.flickr.com/photos/snowman-1/
--------------------------------------

Post Reply