Bullk Rename Relative to Shooting Date

Is the following possible?

Rename all the .NEF (Nikon Electronic Format) files in a particular directory tree such that each has an index number and the lowest index number corresponds to the oldest shooting date and the highest index number corresponds to the most recent shooting date.

Simple Example:

Before:
Seattle.NEF (Shot 3/9/05)
ballroom.NEF (Shot 9/23/07)
ocean.NEF (Shot 6/21/06)

The information in parentheses above and below are not part of the filenames.

After:
DSC_00001.NEF (was Seattle.NEF)
DSC_00002.NEF (was ocean.NEF)
DSC_00003.NEF (was ballroom.NEF)

I realize I'm asking for a lot here - but it doesn't hurt to inquire. I do already understand how to embedd the shoot date in the filename and I can go that route if necessary.

Thanks,
John

If the index number doesn't have to be derived from the shooting date - but you just want them numbered in date order - then it's easy: just add the shooting date column to the Lister and sort by that column, and then use the built-in renumbering of the Rename function to number them in that order.

If you actually want the index number to be derived from the date in some way then you would have to implement some sort of scripted solution.

[quote="jon"]If the index number doesn't have to be derived from the shooting date - but you just want them numbered in date order - then it's easy: just add the shooting date column to the Lister and sort by that column, and then use the built-in renumbering of the Rename function to number them in that order.

[/quote]

Excellent. Thanks. Thats exactly what I want to do.

Ooops...not as easy as we thought. Apparently Opus does not 'see' the shooting date data in .NEF (Nikon Electronic Format Raw Files)

I add the field to the lister okay. I can actually see information for the .jpg files but not for the .NEF ones.

I don't remember if the NEF format is one which doesn't allow actual changes to the file itself once its been created, but if it is, (and even if it's not) you might try using one of the standard "create" or "last modified" columns (which apply to all files) since they very well may have the same timestamp as your internal EXIF timestamp.

John

[quote="JohnZeman"]I don't remember if the NEF format is one which doesn't allow actual changes to the file itself once its been created, but if it is, (and even if it's not) you might try using one of the standard "create" or "last modified" columns (which apply to all files) since they very well may have the same timestamp as your internal EXIF timestamp.

John[/quote]

Excellent suggestion. If not exact it will be very close.

As far as .NEF goes - this is a format that allows you to update the internal information in the file while editing it. It actually journals all your changes so that you can apply 50 changes to the file but turn them all off in one shot and have your original image again - if you're using CaptureNX the Nikon produced photo editing software (I tend to use either that or Elements depending on what I'm doing).

I verified that the .NEF files were healthy - I was able to look at the EXIF data using an editing program. I initially had thought that perhaps I had done something to screw up this internal mechanism.

Thanks for the suggestion.

-John

[quote="JohnZeman"]I don't remember if the NEF format is one which doesn't allow actual changes to the file itself once its been created, but if it is, (and even if it's not) you might try using one of the standard "create" or "last modified" columns (which apply to all files) since they very well may have the same timestamp as your internal EXIF timestamp.

John[/quote]

Still having troubles. However, it may be entirely me.

The premise here is that I have an entire directory tree with many different subdirectories. subdirA and subdirB may both have a file named DSC_00001.NEF

I would like to traverse the entire directory tree eliminating duplicate files wherever they may occur. After the rename process there would be a DSC_00001.NEF and that would be the one and only file on the drive with this name/extension combination. I still wish to preserve the locations of the files within the directory.

I would like to the .xmp files to come with the renamed file as well (rename as one appears to be option on the rename menu - and it works very well if we are talking about the contents of just one directory).

Here is the flow I am performing

Find -> select .
Highlight one file in the results list and then type Ctrl-A to select all files in the results list.
Right click -> Rename

In the rename window I do select

Automatically Rename If Filename Exists
Rename files in selected sub-folders (I suspect this has no effect when doing it from a search window)
Rename matching files as one
Sequential numbering

It appears to treat all three files the same:

subdirA\DSC_00004.NEF
subdirB\DSC_00004.NEF
subdirB\DSC_00004.XMP

After the rename operation all 3 files will still have the same stem. If possible I would like the two files that are in the same directory to have the same stem but a file of like stem in another directory (such as DSC_00004 in subdirA) to obtain a different stem after the rename operation.

Is the above possible?

I believe my problem revolves around the proper use of the "rename as one" option on the rename popup. If I click it all matching stems are preserved which can result in duplicate filenames when dealing with files in multiple directories. If I unclick "rename as one" then all my sidecar .xmp files will become disconnected from what was their matching .NEF file.

I've strived to be cohesive here but realize I may have missed the mark. If so, my apologies.

Perhaps a better description of what I would like to do is:

Rename all files in a directory tree preserving common stems where the file extensions do not match. The result should be that after the operation completes there can only be one DSC_00001.NEF and perhaps one DSC00001.XMP but there cannot be anywhere in the tree two or more DSC_00001.NEF files.

[quote]
Perhaps a better description of what I would like to do is:

Rename all files in a directory tree preserving common stems where the file extensions do not match. The result should be that after the operation completes there can only be one DSC_00001.NEF and perhaps one DSC00001.XMP but there cannot be anywhere in the tree two or more DSC_00001.NEF files.[/quote]

Sigh...slight edit to the above...I meant to say:

Rename all files in a directory tree preserving common stems where the file extensions do not match. The result should be that after the operation completes there can only be one DSC_00001.NEF and perhaps one DSC_00001.XMP but there cannot be anywhere in the tree two or more DSC_00001.NEF files

Turning on the "rename matching filenames as one" option means that all of the files that have the same base filename will still have the same base filename as each other after the rename is done. (The base filename may have changed but it will be the same for all of those files.)

This applies whichever directory the files are in.

So the "rename matching filenames as one" option will defeat any attempt to ensure unique filenames throughout a directory tree.

To get this complex rename to work I think will require either a VBScript (or Perl etc.) Rename Preset or a code-change in Opus to allow a new rename feature.

The Rename Preset script would have to rename and remember the groups of files it was passed in different directories, using the remembered names to determine which names come next. I'd volunteer to write it but I've got way too much else to do at the moment, sorry.

[quote="nudel"]
To get this complex rename to work I think will require either a VBScript (or Perl etc.) Rename Preset or a code-change in Opus to allow a new rename feature.

The Rename Preset script would have to rename and remember the groups of files it was passed in different directories, using the remembered names to determine which names come next. I'd volunteer to write it but I've got way too much else to do at the moment, sorry.[/quote]

DON'T APOLOGIZE! I knew I was asking a lot out this because the need was so specific.

Being a programmer for a living (well, more like UNIX admin these days) it might be within my programming skills to be able to write a script that would do the job (actually, it is within my skills - I just don't know if I too have the time).

I'm going to give it some thought though. Should I come up with a solution I'll gladly share it here.