# Renaming images on import with date/time metadata



## NathAus (Aug 17, 2017)

Hi all,

Does anyone know if it is possible to rename files on import to the capture date and time that is included in the images' metadata? 

For example, if an image's metadata shows me "Date Time Original: 6/1/17 2:45:22 PM" - would it be possible to import this image with a filename of "2017-06-01 14.45.22"?

I've explored the "File Renaming" box on import but can't see anything to this effect.

Welcome any input, thanks!


----------



## Johan Elzenga (Aug 17, 2017)

I'm typing this on my iPhone so I cannot show a screenshot, but you have to look at this box a little better. There is a pop-up with templates and you can also edit templates and save your own. What you want is definitely possible.


----------



## Ian.B (Aug 17, 2017)

not sure you need the minutes/second/hour in the file name as LR will let you see files in "capture" order

I use mostly yyyy mm #### with no dashes/underscores --- from there I use keywords


----------



## Rob_Cullen (Aug 17, 2017)

1. Press F2  (Function key 2) for the rename dialog
2. Click the menu drop-down at the end of the Preset box
3. Choose "Edit" from the menu
4. Build your Renaming Preset by selecting from all the options and dropdown menus
5. Do NOT use full-stops or unusual characters as separators ( dash and underscore are safe)
6. Click the drop-down menu again to Save your Preset.
7. Select this rename Preset when you import.
Can I also suggest you add the original camera file-number-suffix to the preset name.
Edit: agree to delete 'time' unless imperative.


----------



## frozenframe (Aug 17, 2017)

I made some screenshots to help you out a little. You can access the preset for this a couple of different ways. One is to click on the triangle (twirler) on the right side of the *template* found under the *File Renaming *section. 
 
Then select *Edit*. This will bring up a dialog box *File Name Template Editor*. 
 
I've highlighted the section where you select the options for your template. It's a drop-down menu. When you select one, it will be added to the top window of the editor, including the parentheses. What I done to completely replicate your file name structure was to add the hyphens, space and dots at the end of each. This same Template Editor can be accessed through the *Library Menu*, or simply by pressing *F2*. 

 

Example of a file renamed using this template;


----------



## frozenframe (Aug 17, 2017)

My typing is getting way too slow. :(


----------



## Hoggy (Aug 17, 2017)

Also, so you don't get caught out by the same bug that got me... 

You may want to do the renaming AFTER the import is done - if you want to preserve the 'original filename' in the metadata.  If you do the renaming during import, the 'original filename' will  become the new name you are making.  If you don't care, then just disregard this message. 

This has been a bug that has existed ever since I started with LR 4, at least.  Unfortunately I had already renamed thousands of files during import before discovering this little tidbit.


----------



## RikkFlohr (Aug 17, 2017)

Actually Hoggy, this isn't a bug but rather by-design.  There are no plans to change this behavior.


----------



## NathAus (Aug 17, 2017)

Hi everyone, 

Thank you for your responses. 

@I-See-Light and Ron (@frozenframe): your explanation and breakdown of the process worked perfectly - thank you! I was aware you could combine elements from the dropdown menu to build a preset, however I didn’t know you could combine multiples from the same date field to achieve the desired outcome.

@I-See-Light: I’m curious why you oppose the use of full-stops in the filename. I have not experienced any problems but I’d be curious to know if you/others have.

@Ian. B and @I-See-Light: you suggest not including the time unless imperative. For those of you interested, the reason I include the time in my filenames is because I maintain a catalog that also includes iPhone images. The default filename for iPhone images is the YYYY-MM-DD HH.MM.SS format (when imported directly from Dropbox; interestingly iCloud renames them as IMG with a generic number, however I suppose this can be amended with the LR import preset). I want my camera's (.NEF) images to match this format so that proper sequencing of both these and and the iPhone .jpeg images can be achieved. I am aware that images in LR can be sorted by capture time, however for post-production/project purposes it is far easier to work with uniform, sequential filenames. 

@Hoggy and @RikkFlohr: I don’t appear to have the problem you are describing. I have experimented importing a few different images using the new date/time preset and it has retained the original data in the metadata box (screenshot attached); it did not change it to the import date/time.


----------



## DGStinner (Aug 17, 2017)

NathAus said:


> For those of you interested, the reason I include the time in my filenames is because I maintain a catalog that also includes iPhone images. The default filename for iPhone images is the YYYY-MM-DD HH.MM.SS format (when imported directly from Dropbox; interestingly iCloud renames them as IMG with a generic number, however I suppose this can be amended with the LR import preset).


Actually it is Dropbox that does the renaming.  If you take a photo with your iPhone and email it to yourself, it will have the IMG name.


----------



## NathAus (Aug 17, 2017)

Thanks for this correction @DGStinner. Yes, I'm so used to Dropbox that I thought that was the norm. I realized I see "IMG" when emailing to myself on occasion, but it didn't click.

I definitely prefer Dropbox's way of naming images then - seems more practical than iPhone!


----------



## Ian.B (Aug 18, 2017)

not sure if this does apply in this case --- don't make digital photography harder than it is, or needs to be.


----------



## Hoggy (Aug 18, 2017)

NathAus said:


> @Hoggy and @RikkFlohr: I don’t appear to have the problem you are describing. I have experimented importing a few different images using the new date/time preset and it has retained the original data in the metadata box (screenshot attached); it did not change it to the import date/time.



I'm actually referring to separate fields named as such..  In stock LR, they are visible separately in the "Exif and IPTC" and the "DNG" metadata selectors.  I have them combined here using JF's "Metadata Presets" plugin, as shown highlighted in the attached clip.  (I'm not sure why your snip of the first set doesn't show it..  Maybe it has something to do with the 'intricacies' of when the renaming is done, or not done.  Here, the fields do show up in those separate metadata selectors, but maybe that's because I've gotten into the habit of always doing the renaming after import, to preserve them.)

(You can also see my obscenely long filename in the screenshot.   That's so all that info can show up when I hover over images in the filmstrip from within any module.)  




RikkFlohr said:


> Actually Hoggy, this isn't a bug but rather by-design.  There are no plans to change this behavior.



Rikk, thanks for letting me know that..  And although I'm not trying to argue, I don't understand why that can be the case.  If the renaming is done during the import, those fields will *always* be the same no matter what - so what would the point be?

I have noticed somewhat recently, that 2 fields started showing up (I don't remember the "Original RAW Filename" being there early on, at least from within LR).  And although I keep meaning to test it, I always end up forgetting to check if at least the RAW counterpart remains the same if renamed during import.  Is that the reason that this one started showing up - so it truly DOES keep the raw name, as implied?

Mind you, I'm just trying to understand the rationale for there being such differences between whether renaming is done before vs. after import.  I could understand a desire to preserve the name as it was imported, for future renames - but don't understand why they should always end up being the same if renamed _during_ the import.


----------



## NathAus (Aug 18, 2017)

Ian.B said:


> not sure if this does apply in this case --- don't make digital photography harder than it is, or needs to be.



Er, no... I don't think this applies. Thanks anyway


----------



## Rob_Cullen (Aug 20, 2017)

NathAus said:


> I’m curious why you oppose the use of full-stops in the filename


What I should have said was - to avoid the characters that Lightroom notes as "Illegal". And a Full-stop (period) is not one of those. So "full-stops" are go!  and acceptable in Windows-OS.
Although reading many forum posts where Lightroom often 'coughs' on illegal characters I thought it might be wise to suggest avoid the full-stop.


----------



## Hoggy (Aug 20, 2017)

I-See-Light said:


> What I should have said was - to avoid the characters that Lightroom notes as "Illegal". And a Full-stop (period) is not one of those. So "full-stops" are go!  and acceptable in Windows-OS.
> Although reading many forum posts where Lightroom often 'coughs' on illegal characters I thought it might be wise to suggest avoid the full-stop.



...  And this now answers my question on what the heck a full stop was, when not referring to f-stops/light.


----------



## LouieSherwin (Aug 20, 2017)

Hoggy said:


> ... And this now answers my question on what the heck a full stop was, when not referring to f-stops/light.



This term came from telegraphs because the original character set did not have punctuation and there needed to be a way to delineate the end of a sentence.

You know telegraphs, I recently heard it aptly described as the original Twitter except it took hours in stead of seconds and was delivered by a messenger.

-louie


----------



## Gnits (Aug 20, 2017)

If you write scripts it is often a good idea to avoid use full stops in filenames (other than .ext). I will use underscore (eg my_file001.jpg) or Capitalisation (eg MyFile001.jpg). Scripts and various languages sometimes use full stops in unexpected ways.


----------

