Sequence numbers in renamed files

geraldmarsden
Posts: 20
Joined: 28 Jan 15 18:28

Sequence numbers in renamed files

Post by geraldmarsden »

I have imported files and want to rename them as follows: yymmdd-sequence number.file extension. I have not found a way to avoid the sequence number drop trailing zeros. A series of my sequence numbers for a given date, occur in this order in the database: 1,10,11,12,13,...18,19,2,20,21,...28,29,3,30.... My sequence number controls are set as follows: Offset = 1, Increment = 1, Length padding = 1, Reset number = When date changes. I've not found a thread in the forum that addresses this issue. I'd appreciate help. Thanks
Mike Buckley
Posts: 1194
Joined: 10 Jul 08 13:18

Re: Sequence numbers in renamed files

Post by Mike Buckley »

geraldmarsden wrote:Length padding = 1
Change that value to 2 to create two-digit numbers such as 01, 02, etc. up to 99. Change the value to 3 to create 001, 002 etc. up to 999. Etc., etc., etc.
geraldmarsden
Posts: 20
Joined: 28 Jan 15 18:28

Re: Sequence numbers in renamed files

Post by geraldmarsden »

I have changed the length padding to 3 but it makes no difference. The trailing zeros are still dropped as I described in my first post in this thread.
geraldmarsden
Posts: 20
Joined: 28 Jan 15 18:28

Re: Sequence numbers in renamed files

Post by geraldmarsden »

I have not stated the problem clearly. It is not that trailing zeros are dropped; rather single digits are treated as if there was a trailing zero such that file number 2 appears between file numbers 19 and 20, file 3 between files 29 and 30, etc.
Mike Buckley
Posts: 1194
Joined: 10 Jul 08 13:18

Re: Sequence numbers in renamed files

Post by Mike Buckley »

geraldmarsden wrote:single digits are treated as if there was a trailing zero such that file number 2 appears between file numbers 19 and 20, file 3 between files 29 and 30, etc.
I think you meant to write that single digits are being treated as if there is no trailing zero, not as if there is one. I would expect that if indeed the file numbers are single digits as you mention.

Once you have changed the length padding to 3, the first renamed file should be 001, which is a three-digit number, not a single-digit number. (At least I think it's a three-digit number; I could be wrong.)

Are you saying that file 003 is displayed between 029 and 030? If so, I have no idea what is going on, as I always use a Length Padding value of 3 and I have never experienced your issue.
geraldmarsden
Posts: 20
Joined: 28 Jan 15 18:28

Re: Sequence numbers in renamed files

Post by geraldmarsden »

Thank you, Mike, for your responses.

1) Even though I have shifted to length padding = 3 my first file displays a sequence number of 1; no zeros! None of the first 99 files has a leading zero.

2) I don't think my description of what is happening is adequate. The best I can do at this point is to repeat. File 140521-2.3FR shows up in the presumably ordered list between 140521-19.3FR and 140521-20.3FR., and so on. I guess you could say that file # 2 is being treated as if it were also file # 20. And that is why I used the "trailing zero" language. Clearly file # 2 shouldn't have a trailing zero, but it treated as if it does.
tstoddard
Posts: 605
Joined: 07 Sep 12 11:51

Re: Sequence numbers in renamed files

Post by tstoddard »

geraldmarsden,

I think the confusion lies in the use of the term "trailing zeros" and the assumption that the single digit 2 is being sorted as if it were 20. That is not actually the case. File names are actually alphanumeric strings and are sorted alphabetically (or alphanumerically). It really has nothing to do with the numeric value of the numbers at the end of the name but in the actual position within the string in which the digit appears.

Forgive me if you already understand this but based on the original post it seems that you don't.

When a computer compares two "strings" to determine which comes first (alphabetically) if compares the "characters" in the string one at a time (normally from left to right) until if finds a point where one is higher in the sort order than the other. So if we had two strings, "0001" and "00002", the computer would sort 00002 before 0001. It would do this because as it goes from left to right and reaches the 4th position, where it would find a 1 in the first string and a 0 in the second string. Obviously, 0 comes before 1 so 00002 will be considered less (or lower) then 0001 and would be sorted ahead of 0001 when sorting in ascending order. Now if you took one of the zeros away from the front of the second string and made it 0002, it would come after 0001 or even 00019. In other words, the "9" would not even be taken into consideration because the comparison would stop at the 4th character in the string. If you put the two strings 0001 and 00002 into a spreadsheet that expects only numeric characters and interprets them as numbers then 00002 would be considered greater than 0001 and would be sorted accordingly.

So, what does this mean to you? It means that you can control the sorting by including "leading zeros" (not trailing zeros) in your file names. That is what setting the "Length Padding" function does. Setting it to 3 tells the system that the number should be at least three digits in length and if it is not, it will "pad" the number with "leading zeros" to make it three digits (or characters) long. For example, 43 would be changed to 043. The number 143 would not change. If you used 43 and 143 in your file names, the "43" would have a higher sort order then 143, but 043 would have a lower sort order than 143.

With length padding set to 3, as long as you don't go over 999, your file names will sort the way you want them to. If you anticipate sequences that will exceed 999 then you could make the length 4 characters or even longer.

I hope this helps clear your confusion.

EDIT: It looks like you replied while I was typing this. I'm sorry if you already understood it. It sounds like your problem is that the padding isn't working as expected in your renaming rules. Perhaps you could show a screen shot of the renaming panel as you have it set. I'm not on a computer with PSU installed so I'm not sure exactly what to tell you to do.
Tom Stoddard
Mike Buckley
Posts: 1194
Joined: 10 Jul 08 13:18

Re: Sequence numbers in renamed files

Post by Mike Buckley »

geraldmarsden wrote:1) Even though I have shifted to length padding = 3 my first file displays a sequence number of 1; no zeros!
I agree with Tom that we need to see a screenshot of the Rename dialog box. Please be sure to include the entire dialog box. That's because we need to see the original filename.ext and the revised filename.ext displayed at the top of the panel and the details of your renaming rule.

I've been using the Length parameter for almost seven years with the only software changes being the user interface to make it happen. In all that time I've never experienced the issue you are describing, so we'll figure this out.
geraldmarsden
Posts: 20
Joined: 28 Jan 15 18:28

Re: Sequence numbers in renamed files

Post by geraldmarsden »

Thank you both for your help. I've made an end run around this problem. My practice has been to download my CF cards first, into a RAW archive file and second, into a set of annual folders. The latter were then imported into Lightroom as the basis for its catalog. When I went to PSU I imported the files from the folders I had used as the basis for the Lightroom catalog. It is with these files that I encountered the problem we have been discussing.

I have now created new folders and copied files from the RAW archive to them. Note, these have never been processed by any cataloging software. PSU renamed them perfectly. So, my conclusion is that, over the several releases of Lightroom, the files had become corrupted and that corruption led the the renaming problem.

Unless you think otherwise, I doubt there is profit in attempting to go further with this issue. Thanks again for your attempts to provide assistance -- I'm deeply appreciative!

Gerald
Mike Buckley
Posts: 1194
Joined: 10 Jul 08 13:18

Re: Sequence numbers in renamed files

Post by Mike Buckley »

Good to know you've got the sequence numbering working as expected!
geraldmarsden
Posts: 20
Joined: 28 Jan 15 18:28

Re: Sequence numbers in renamed files

Post by geraldmarsden »

I wrote to soon. I believed the catalog was correctly sequenced when I last posted. Then I began to add labels. The file was sorted by file name. As I worked back and forth among the files I began to see the old problem again; that is for a given date the sequence was out of order.

What I am aiming for is the have the capture date in the form YYMMDD followed by a hyphen and the a sequence number followed by the file extension. The sequence number is to occur in the order of the captures. Following is a series that illustrates what I have:

I start with 130424-361.3FR. All is well till we get to 130424-369.3FR. Next comes 130424-37.3FR and the series go on asfollows: 130424-370.3FR, 130424-371.3FR, 130424-38.3FR, 130424-39.3FR, 130424-4.3FR, 130424-40.3FR, ... 130424-49.3FR, 130424-5.3FR, 130424-50.3FR, etc. When I sort by capture date they all line up as they should. Could it be that the date the rename screen is keying on is not the capture date?

I also found another other problem. Some files show the following file name: 132105-2(001).3fr. I don't understand where the number in parns comes from. Most files don't have it, but there are several lengthy series in which all files have the (001).

I have a screen shot of my Rename screen, but I don' know how to transmit it to you, never having done this before.

Gerald
Mike Buckley
Posts: 1194
Joined: 10 Jul 08 13:18

Re: Sequence numbers in renamed files

Post by Mike Buckley »

When you open the window that allows you to post a reply, look below the area that you type in for the "Upload attachment" tab. Once you select that tab, the rest is intuitive for uploading your screen shot.
Mike Buckley
Posts: 1194
Joined: 10 Jul 08 13:18

Re: Sequence numbers in renamed files

Post by Mike Buckley »

geraldmarsden wrote:Could it be that the date the rename screen is keying on is not the capture date?
That depends on the details of your renaming rule. We'll take a look at that once you upload your screen shot. I could post the renaming rule you should use but I think it will be more helpful for us to see your renaming rule. It's kind of like teaching you how to fish rather than giving you the fish.
Some files show the following file name: 132105-2(001).3fr. I don't understand where the number in parns comes from.
The number displayed within parenthesis is automatically added when a file located in the folder already has the filename.ext created by your renaming rule. Adding that number prevents your pre-existing file from being written over.
geraldmarsden
Posts: 20
Joined: 28 Jan 15 18:28

Re: Sequence numbers in renamed files

Post by geraldmarsden »

I am attaching a screen shot
Attachments
Untitled.png
Untitled.png (54.06 KiB) Viewed 8915 times
tstoddard
Posts: 605
Joined: 07 Sep 12 11:51

Re: Sequence numbers in renamed files

Post by tstoddard »

geraldmarsden,

You currently have the "length" of your ImageNumber set to 1. You show some files with three digit numbers. Assuming you don't have any four digit numbers you need to set your length value to at least 3. To do that, you would simply click on the Image Number area of the Rename File panel and a smaller panel will open in which you can change the length to 3. In that panel is refers to the length at "Length Padding". You will need to rename all of your files as a batch if you want them to have the correct sequence so make sure you sort them the way you want them to be sorted before doing that. In other words, if you want the sequence numbers to be in the date order, make sure to sort your collection in date order first and then select the entire collection and then do a batch rename. If you leave them sorted by their current file names, the sequence numbers will end up reflecting the way that they are currently sorted.

I hope that helps.

ADDED: You mentioned that you use Lightroom also. I don't but I imagine that renaming these files in Photo Supreme may confuse Lightroom. I'm not sure what you will have to do to account for that in Lightroom but I thought I should mention it. The point of the sequence numbers is really only to insure that you have unique file names. You don't have to use them to sort your images. I prefer to be able to have my images sort correctly by file name so I understand why you would want that but if you don't need that you can simply sort by something other than file name. Let us know if you are not certain how to do that.
Tom Stoddard
Post Reply