• Welcome to the Lightroom Queen Forums! We're a friendly bunch, so please feel free to register and join in the conversation. If you're not familiar with forums, you'll find step by step instructions on how to post your first thread under Help at the bottom of the page. You're also welcome to download our free Lightroom Quick Start eBooks and explore our other FAQ resources.
  • Stop struggling with Lightroom! There's no need to spend hours hunting for the answers to your Lightroom Classic questions. All the information you need is in Adobe Lightroom Classic - The Missing FAQ!

    To help you get started, there's a series of easy tutorials to guide you through a simple workflow. As you grow in confidence, the book switches to a conversational FAQ format, so you can quickly find answers to advanced questions. And better still, the eBooks are updated for every release, so it's always up to date.
  • Dark mode now has a single preference for the whole site! It's a simple toggle switch in the bottom right-hand corner of any page. As it uses a cookie to store your preference, you may need to dismiss the cookie banner before you can see it. Any problems, please let us know!

Automating Capture date from file name

Status
Not open for further replies.

ColMac9090

Active Member
Joined
Jan 25, 2011
Messages
247
Location
Edinburgh, Scotland
Lightroom Experience
Intermediate
Lightroom Version
Classic
Lightroom Version Number
Lightroom Classic version: 10.2 [ 202103041821-226a1211 ]
Operating System
  1. Windows 10
I have 1000+ documents Family history documents that I have scanned in to my library.

They all have a date in the file name, something like B Cert 1891 07 20 John H Smith.jpg.

Unfortunately others will start with Death, Grave, Gravestone etc, so I cannot use LR's File name sort to view them by their original date (which I know is not the actual capture date).

I am now trying to manually edit the File Created date to match the date in the file name, so that I can sort mainly in LR, & LR web but it is obviously a massive task. Does anyone know of any software that would enable me to automate some part of the process.

I cannot really rename the files to start with the date, as all images are already in my Family History software program with links to the original file names, so that is not really an option.

I suspect Regular Expressions might enable this with the right software. I am even less than a novice in RE, but I could probably learn enough to cope with a bit of help from on-line tutorials if I had the right software.

Would Irfanview deal with this?
 
A sketch of a possible approach that doesn't involve programming:

- Use the LR/Transporter plugin to export a CSV file of filenames.

- Open the CSV file in Excel and use Excel formulas to generate the desired date strings in a new column. Save as a new CSV file. Alternatively, use a text editor that has support for regular expressions (e.g. Sublime) to generate the new column.

- Import the new CSV file with LR/Transporter, using that column to set the IPTC Date Created field.

- Finally select all the photos and do Edit > Capture Time / Change All (to force LR to copy IPTC Date Created into its internal capture-date field).

If you don't have familiarity with Excel formulas or a text editor supporting regular expressions, this will have a steep learning curve.
 
Thanks very much for that suggestion. I'll have a look at the weekend. EXcel date formulas will not be a problem, so I'll have a try.
 
I think you'll need to use the Excel function FIND to parse the filename into its date parts, MID to extract those parts, and then CONCAT to concatenate them into the format expected by LR's IPTC Date Created.
 
Finally select all the photos and do Edit > Capture Time / Change All (to force LR to copy IPTC Date Created into its internal capture-date field).
It occurred to that this approach will only work if the photos don't already have a capture date stored in their metadata; otherwise, a bug in LR will prevent the date you enter in IPTC Date Created from being recognized as the industry standard capture date.

If your photos do have capture date, then you'll have to use the CSV file you create with dates to generate a batch script that invokes Exiftool to set the capture dates, which involves even more of a learning curve :-<
 
Thanks for all the help.. I managed to get parts one, two & three done fairly easily, but hit a brick wall with the last bit. before I saw your latest message.

Had a bit of an issue trying to do the export, as I kept looking for a token to insert a carriage return, before I twigged that hitting the actual enter key was all that was needed!

As I thought, the Excel issue was quiet easy, and Import also worked as expected.

So far I've just used the demo version which I've used on a copy of 5 files (the demo limit). All files are in one folder.

I'm slightly puzzled by this issue in the instructions.

"When you run the import you can choose whether to match records against the entire database or just the selected images."

When I come to do the Transporting in earnest, I will be using files from lots of folders, I'm a little concerned about this bit. The help file offers no explanation of what this option means in practice.

My plan had been to create a dumb collection with all the images I want to work on, select and process them . Will the differing paths affect this? I'm concerned in case there happens to be a duplicate file name in there.


When I came to the editing, I read your instruction " Edit > Capture Time / Change All", but couldn't get it to work. I then assumed you meant

Metadata > Edit Capture Time / Change All

but this wasn't working for me, then I saw your update.

If your photos do have capture date, then you'll have to use the CSV file you create with dates to generate a batch script that invokes Exiftool to set the capture dates, which involves even more of a learning curve

I'll have a look at Exiftool now.

Really appreciate your help.


Colin
 
I'm slightly puzzled by this issue in the instructions.

"When you run the import you can choose whether to match records against the entire database or just the selected images."

When I come to do the Transporting in earnest, I will be using files from lots of folders, I'm a little concerned about this bit. The help file offers no explanation of what this option means in practice.

My plan had been to create a dumb collection with all the images I want to work on, select and process them . Will the differing paths affect this? I'm concerned in case there happens to be a duplicate file name in there.
It may not be directly relevant, since you're investigating the Exiftool option, but here's a possible solution for future reference:

It appears that LR/Transporter has a limited number of fields it can match records against, in particular, filename but no full file path, which is a strange omission, since duplicate filenames in a catalog aren't unusual.

I think the workaround is to use the plugin's Change Metadata command to set the Job Identifier of each photo to {originalPath}. Then on import, you can match records using Job Identifier.
 
I'll have a look at Exiftool now.
If you go that route: Select all the photos and do Metadata > Save Metadata To File. Then run the batch script that uses Exiftool to change the capture date of each photo. Then do Metadata > Read Metadata From File to read in the new capture dates.

Exiftool by default makes backup copies of the photos it changes. I recommend you make two catalog backups before you start, since these actions aren't undoable via Undo.
 
Status
Not open for further replies.
Back
Top