# File rename problem



## gYab61zH (Aug 25, 2019)

On import I rename all my files as follows:

Date (YYYY)-Date (MM)-Date (DD)_Hour-Minute-Second(Filename number suffix)

Now sometimes it emerges that I mistakenly left the camera on the wrong time zone, so I select all the files concerned and re-adjust the Capture Time in Metadata > Edit Capture Time. So far, so good. However, I would then like to rename all my files so the new capture time is also reflected in the file name, and that is when things go wrong. Using the same template as given above I then end up with a different result, in that the Filename number suffix is omitted:

original filename: 2019-08-15_16-23-35(5236).RAF
renamed filename: 2019-08-15_15-23-35().RAF

Since the filename suffix is the only thing that links the file to the original camera filename I would like to preserve it. Can anyone help? Does anyone know why the Filename number suffix is lost when a file is renamed the second time using the same template?


----------



## Hal P Anderson (Aug 25, 2019)

I would guess that the filename suffix is nonexistent for files that have already been renamed. LR isn't smart enough to know that "(5236)" was created from the original suffix. 

LR does, however, allow you to use the Original filename in the rename template, so you could probably rename all the images back to their original names and then rename them again to reflect the new time and date.


----------



## LouieSherwin (Aug 25, 2019)

I suspect that it is the use of parenthesis in your new file name. I think that the string matching to determine the sequence number is if the last four positions are numeric. In your case that would return "236)" and not be recognized as a sequence. 

-louie


----------



## gYab61zH (Aug 25, 2019)

Hal P Anderson said:


> LR does, however, allow you to use the Original filename in the rename template, so you could probably rename all the images back to their original names and then rename them again to reflect the new time and date.



This does not work when files are renamed on import, because then the new name is listed as the original name! As to the number suffix, I have always assumed LR gets this from somewhere in the metadata rather than from the original file name and therefore could not understand why it could not manage the renaming.


----------



## Jim Wilde (Aug 25, 2019)

Use the (new) Preserved Filename option, rather than Original Filename.


----------



## gYab61zH (Aug 25, 2019)

LouieSherwin said:


> I suspect that it is the use of parenthesis in your new file name. I think that the string matching to determine the sequence number is if the last four positions are numeric. In your case that would return "236)" and not be recognized as a sequence.
> 
> -louie


You may well be right. I renamed some files and dropped the parentheses, and this time a subsequent renaming operation using the above template worked fine. The parentheses are clearly to blame. From now on I will use the following template on import:

Date (YYYY)-Date (MM)-Date (DD)_Hour-Minute-Second_Filename number suffix


----------



## gYab61zH (Aug 25, 2019)

Jim Wilde said:


> Use the (new) Preserved Filename option, rather than Original Filename.


Thanks Jim, that worked. Great new option!


----------



## Califdan (Aug 25, 2019)

In my renames, I use a "#" in front of the original file number just to separate it from the rest of the name.   In your case it would look like 

2019-08-24_142639 #1234


----------



## PhilBurton (Aug 25, 2019)

gYab61zH said:


> On import I rename all my files as follows:
> 
> Date (YYYY)-Date (MM)-Date (DD)_Hour-Minute-Second(Filename number suffix)
> 
> Now sometimes it emerges that I mistakenly left the camera on the wrong time zone, so I select all the files concerned and re-adjust the Capture Time in Metadata > Edit Capture Time. So far, so good. However, I would then like to rename all my files so the new capture time is also reflected in the file name, and that is when things go wrong.


Actually I am right now trying to solve this issue for several hundred photos I took in 2017 in Denmark and Norway.  My camera's clock reset itself to 2007 because the camera clock's backup battery failed.  I use Windows 10, so if you use MacOS the specific problem would be different.

Send me a private message.

Phil


----------



## gYab61zH (Aug 25, 2019)

I presume LR for Windows will also have this new Preserved Filename option. So all you need to do is rename them all to their original file name. Readjust the Capture Time in Metadata > Edit Capture Time, and then rename everything on the basis of the date and time. But I assume I misunderstand your problem?


----------



## PhilBurton (Aug 26, 2019)

gYab61zH said:


> I presume LR for Windows will also have this new Preserved Filename option. So all you need to do is rename them all to their original file name. Readjust the Capture Time in Metadata > Edit Capture Time, and then rename everything on the basis of the date and time. But I assume I misunderstand your problem?


It was my impression, from some tests I did late last  year, that adjusting date/time in Lightroom does NOT change the date/time shown in Windows Explorer.  If I am wrong, or that function has been changed, then I can save a lot of time doing these experiments.

What I want is the date/time in Windows Explorer to be the same as the EXIF create date, after adjusting date/time differences.  So far, using EXIFTool GUI (which is very convenient) I can change the EXIF dates at will, but once I do that, the Windows Explorer date/time get shifted.  So right now (when I have time) I am experimenting with general purpose Windows utilities that change the Windows Explorer file date/time.


----------

